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
6
votes
1 answer

How to put arbitrary widgets into a gtk.Menu?

How can any gtk.Widget (eg. a progress bar) be put into a gtk.Menu as one of the menu items?
david4dev
  • 4,854
  • 2
  • 28
  • 35
6
votes
3 answers

How to display an image from web?

I have written this simple script in python: import gtk window = gtk.Window() window.set_size_request(800, 700) window.show() gtk.main() now I want to load in this window an image from web ( and not from my PC ) like…
xRobot
  • 25,579
  • 69
  • 184
  • 304
6
votes
1 answer

gtk minimum size

Is there an easy way to request that a GTK widget have a minimum width/height? I know you can do it on the column of a TreeView, but is it available for general widgets?
Claudiu
  • 224,032
  • 165
  • 485
  • 680
6
votes
2 answers

Pygame and PyGTK side by side

I'm working on a python project where I have a pygame window, but I'd also like to have a PyGTK window next to it at the same time with information about objects inside the pygame window. However, when I start the PyGTK window the pygame window…
Spooky
  • 1,752
  • 21
  • 37
6
votes
1 answer

PyGTK: how to make a clipboard monitor?

How can I make a simple clipboard monitor in Python using the PyGTK GUI? I found gtk.clipboard class and but I couldn't find any solution to get the "signals" to trigger the event when the clipboard content has changed. Any ideas?
envy
  • 127
  • 3
  • 10
6
votes
3 answers

Gtk.CssProvider.load_from_data TypeError: Item 0: Must be number, not str

I was getting this error when running my gtk project from a terminal with python3 myapp.py, but not when launching my app via Sublime-Text-3's python build system! How weird. TypeError: Item 0: Must be number, not str The code at fault was…
ThorSummoner
  • 16,657
  • 15
  • 135
  • 147
6
votes
1 answer

Error install PyGtk

I tried to install pygtk on mac. I downloaded the pygtk file, opened up terminal and set it to my working directory, then ran the command "python setup.py install". There was an import error because there was no module dsextras. Does anyone know how…
None
6
votes
3 answers

Entry with suggestions

I'm building a small PyGTK application and I have an text input field (currently a ComboBoxEntry) which is populated with a few values that the user should be able to choose from. I think what I want to do is to filter out the matching fields and…
Joelbitar
  • 3,520
  • 4
  • 28
  • 29
6
votes
2 answers

Making a Python/GTK CheckMenuItem, when clicked, not close the menu

Using Python and PyGTK I've got a GtkMenu with various GtkCheckMenuItems in it. When the user clicks one of the checkboxes the menu closes. I'd like for the user to be able to check a series of checkboxes without the menu closing each time. I've…
davedavedave
  • 139
  • 1
  • 7
6
votes
2 answers

pygtk: determine key is a modifier

I've got key-press-event handler and i need to determine which kind of key was pressed: modifier or not? It's not in event.state, because this field works only when modifier was pressed with something else, but i need this for single key (i.e.…
Daniel
  • 4,272
  • 8
  • 35
  • 48
6
votes
1 answer

Python + GTK - How to suppress warnings

When I launch my python program, the terminal floods with: rcGUI.py:331: Warning: Attempt to add property GtkSettings::gtk-label-select-on-focus after class was initialised label1 = gtk.Label("Current tools configured:") rcGUI.py:286: Warning:…
user3123537
  • 71
  • 1
  • 2
6
votes
2 answers

Python GTK+: create custom signals?

Is it possible to create new signals in Python GTK+ ? I'd like a skeleton code example, please.
jldupont
  • 93,734
  • 56
  • 203
  • 318
6
votes
3 answers

Force background of matplotlib figure to be transparent

I'm trying to include a matplotlib figure in a Python Gtk3 application I'm writing. I'd like to set the background colour of the figure to be transparent, so that the figure just shows up against the natural grey background of the application, but…
Donagh
  • 165
  • 2
  • 2
  • 6
6
votes
2 answers

Python, thread and gobject

I am writing a program by a framework using pygtk. The main program doing the following things: Create a watchdog thread to monitor some resource Create a client to receive data from socket call gobject.Mainloop() but it seems after my program…
David Guan
  • 809
  • 1
  • 8
  • 13
6
votes
1 answer

default arguments removed in gtk3?

I try to port my pygtk code to gtk3. I get this error: TypeError: pack_start() takes exactly 5 argument(s) (2 given) It seams that the default arguments have been removed. Does gtk3 (accessed from python) not support default arguments? Since the…
guettli
  • 25,042
  • 81
  • 346
  • 663