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

glib.GError: Error interpreting JPEG image file (Unsupported marker type 0x05)

I am using gtk.gdk.PixbufLoader since several years. Today, I try to load a jpg file from a new android device and get this exception: Traceback (most recent call last): File "myscript.py", line 118, in next loader.write(buf) glib.GError:…
guettli
  • 25,042
  • 81
  • 346
  • 663
9
votes
5 answers

Changing the selected item colour in a GtkTreeview using python

I have a dialog which contains a pygtk.treeview for listing tasks by priority. Each row has the background colour set based on that priority, so for example the highest priority has a light red background. The row selection color is not so easy to…
Jon
  • 9,815
  • 9
  • 46
  • 67
9
votes
7 answers

pyGame within a pyGTK application

What is the best way to use PyGame (SDL) within a PyGTK application? I'm searching for a method that allows me to have a drawing area in the GTK window and at the same time being able to manage both GTK and SDL events.
borrego
  • 709
  • 8
  • 7
9
votes
4 answers

pygtk how to embed external application within my pygtk GUI

I'm desiging a pygtk GUI and want to embed an external application into it. Does anyone have any idea how this can be done?
M0E-lnx
  • 717
  • 10
  • 24
9
votes
7 answers

PyGTK: dynamic label wrapping

It's a known bug/issue that a label in GTK will not dynamically resize when the parent changes. It's one of those really annoying small details, and I want to hack around it if possible. I followed the approach at 16 software, but as per the…
detly
  • 29,332
  • 18
  • 93
  • 152
9
votes
4 answers

Is PyGTK or PyQT preferred for making GTK-native Python apps?

I'm a web developer looking to get my feet wet with coding up a little desktop app for Ubuntu in Python. I've scoured the web looking for the pros and cons of PyGTK vs. PyQT and can't really find any good comparisons. What do you guys think? Do they…
Mike Crittenden
  • 5,779
  • 6
  • 47
  • 74
9
votes
3 answers

Gtk.Treeview get current row index in Python

How to get index of current selected row in Gtk.TreeView in Python ?
deni123
  • 103
  • 1
  • 3
8
votes
1 answer

Add tooltips to the entries in a GTK ComboBox?

Is there any way to add tooltips to the individual entries of a combobox? I'd like it so that when the combobox is open (and only when it is open) and the user mouses over one of the possible selections, additional information would show up in a…
Jeremy
  • 2,826
  • 7
  • 29
  • 25
8
votes
3 answers

What is the fastest way to draw an image in Gtk+?

I have an image/pixbuf that I want to draw into a gtk.DrawingArea and refresh frequently, so the blitting operation has to be fast. Doing it the easy way: def __init__(self): self.drawing_area = gtk.DrawingArea() self.image =…
Grumbel
  • 6,585
  • 6
  • 39
  • 50
8
votes
3 answers

Introspection on pygtk3 possible?

One of the great things of python is the ability to have introspection on methods and functions. As an example, to get the function signature of math.log you can (in ipython) run this: In [1]: math.log? Type: builtin_function_or_method Base…
xubuntix
  • 2,333
  • 18
  • 19
8
votes
3 answers

Periodically call a function in pygtk's main loop

What's the pygtk equivalent for after method in tkinter? I want to periodically call a function in the main loop. What is the better way to achieve it?
houqp
  • 761
  • 1
  • 8
  • 12
8
votes
1 answer

pygtk change background color of gtkHBox widget

I have a GTK ui that has a gtkVBox that gets gtkHbox's containing content dynamically added to it as the user works. The ui is getting crowded and it's difficult to tell what Hbox the components belong to (they repeat.) I would like to alter the…
David Just
  • 288
  • 1
  • 4
  • 12
8
votes
1 answer

PyGTK blocking non-GUI threads

I want to play with the thread-bugs with PyGTK. I have this code so far: #!/usr/bin/python import pygtk pygtk.require('2.0') import gtk import threading from time import sleep class SomeNonGUIThread(threading.Thread): def __init__(self, tid): …
izidor
  • 4,068
  • 5
  • 33
  • 43
8
votes
1 answer

Placing Gtk.Widget in Box with top padding

I have a box like this: import gi gi.require_version('Gtk', '3.0') from gi.repository import Gtk [...] box_outer = Gtk.Box(orientation=Gtk.Orientation.VERTICAL, spacing=0) box_outer.pack_start(Gtk.Label('Label1'), False, False,…
user1406177
  • 1,328
  • 2
  • 22
  • 36
8
votes
1 answer

Gtk.Image on HiDPI displays

I use a Gtk.Image backed by a GdkPixbuf.Pixbuf to display a photo. I scale the photo to fit the available space in response to the size-allocate signal of the parent widget. The problem is that on HiDPI displays, every dimension is in logical pixels…
Zoltan
  • 2,928
  • 11
  • 25