Questions tagged [pygtk]

PyGTK is the Python binding for the GTK+ widget library.

PyGTK lets you easily create programs with a graphical user interface using the Python programming language and the GTK+ library. GTK+ provides all kinds of visual elements and utilities, and is the official toolkit of the GNOME Desktop.

PyGTK applications are multiplatform and able to run, unmodified, on Linux, Windows, MacOS X and other platforms.

For more information, see the Wikipedia page of PyGTK.

2238 questions
0
votes
1 answer

How to recieve events from Main window when modal dialog has been put up in Python Gtk

I have client server program. My python always listens to the data passed in the socket. If I get certain predefined strings from the server i display a modal dialog.The dialog can be closed in 2 ways. First way is user should react to the dialog…
Shrikanth Kalluraya
  • 1,099
  • 1
  • 16
  • 34
0
votes
1 answer

How can I access the Gtk.Box in Gtk.Dialog?

I get an error (Gtk-WARNING **: 18:33:56.632: Attempting to add a widget with type GtkBox to a GtkDialog, but as a GtkBin subclass a GtkDialog can only contain one widget at a time; it already contains a widget of type GtkBox) when executing this…
Heschy
  • 31
  • 5
0
votes
0 answers

Are there any ways to loop in a button press callback method until the button is released?

So im using gtkmm specifically here. What I'm working on: I'm implementing a feature in which when I press in a certain window a parameter is increased/decreased depending on if the mouse moves left/right. What needs to be done: To be able to…
0
votes
1 answer

Switching from WebView to another under GtkScrolledWindow

I am trying to create a simple web browser with already-opened multiple tabs using WebKitGtk2 and Python. I want it such that if I click a button, the GtkScrolledWindow will drop its current viewport (Which contains the current WebView), and use the…
Madno
  • 910
  • 2
  • 12
  • 27
0
votes
0 answers

Is there a Way to Toggle GTK Switch to OFF state under a specific condition in Python, programmatically?

I Am trying to set a GTK Switch to OFF state ,from ON State, without the human intervention such as mouse click or keyboard key press. So is there any way to toggle switch states via Python+GTK ? Any guidance on this could be helping !!
0
votes
1 answer

GTK Dialog constructor cannot be used to create instances of a subclass MessageDialog WTF

When I run the following code: dialog = Gtk.MessageDialog.new( None, Gtk.DialogFlags.MODAL, Gtk.MessageType.QUESTION, Gtk.ButtonsType.YES_NO, f'Do you really want to {action}…
mijorus
  • 111
  • 1
  • 7
0
votes
3 answers

run py2exe under windows 7, can not excecute file under windows XP

I created a exe-file from my Python+Gtk application using py2exe. With windwos 7 it works, but I can't get it running under windwos XP. I get the following error: Traceback (most recent call last): File "debug4iConnect.py", line 1, in
stefanr
  • 111
  • 1
  • 8
0
votes
0 answers

Python Gtk 3.24 - AttributeError: type object 'Gtk' has no attribute 'Builder'

This attribute error appeared when I try to run my code using Gtk and Python. Would anyone know how to solve it? This is my code: import gi gi.require_version('Gtk','3.0') from gi.repository import Gtk builder =…
0
votes
1 answer

Dynamically generate pygtk menu's based on dictionaries and lists

I have a list of options that I read from an xml file. In the list there is information like codenames, item relations, child codenames ... I use the following functions to generate pygtk boxes with the proper buttons in it. My problem is that I…
0
votes
2 answers

How to change the background color of a gtk.MenuItem()

For a pop-up menu made in Gtk, I would like to have the first menu item as a header. Preferably its background should be white. Since---according to the documentation---one cannot change a gtk.Label's background colour, but rather must change its…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
0
votes
2 answers

PyGTK entry.set_placeholder_text doesnt work - missing tex

I am attaching a piece of my code in which I try to display the text in the Entry field with predefined text. I use entry.set_placeholder_text for this, but unfortunately the text does not appear. Is there an effective solution? # -*- coding: utf-8…
Radek
  • 57
  • 6
0
votes
0 answers

Gtk how to bring my app to foregrout when it is minimized or in another workspace

I am trying to develop a simple Gtk app which should be launched with a custom shortcut. Right now, I call the following methods to present the window to the user: # if the user executes the same shortcut but another instance is already opened, we…
mijorus
  • 111
  • 1
  • 7
0
votes
1 answer

How to connect to MediaPlayer2.Player PlaybackStatus signal using pygtk?

I actually want to display the information about the media or song currently being played with a window as a popup containing the artwork and the song name etc. I read about that a PlaybackStatus signal is emitted whenever a media is playing or…
0
votes
1 answer

Editable label in Python GTK+ 3?

I'm new to GTK programming. I want to have a Label widget whose text can be edited, kind of like this: https://docs.gtk.org/gtk4/class.EditableLabel.html. The problem is I have no idea how to implement this. I understand that Gtk.Button has a…
buffle
  • 123
  • 2
0
votes
1 answer

Reopened PyGtk window is empty

I am working with Glade to make a simple GUI application using PyGTK. I have two windows, one only showing up when a button is pressed. def on_preview_clicked(self, widget): print "You clicked the Preview button" prev =…
1 2 3
99
100