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
7
votes
3 answers

gtk treeview: place image buttons on rows

For each row in my treeview, I want 4 image buttons next to each other. They will act like radio buttons, with only one being activateable at a time. Each button has an 'on' and 'off' image. How do I do this? I figured out how to put images there,…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
7
votes
1 answer

GTK+ Filechooser to open both files and folders

How do I get my filechooser to be able to select both files and folders when the open button on the filechooser dialog is hit ? I want to squeeze the ability to open files and filders in just one filechooser. I am using GTK+ and Python.
thotheolh
  • 7,040
  • 7
  • 33
  • 49
7
votes
1 answer

How to enable/disable toolbar items?

How do you make a gtk.ToolButton disabled so that it is 'greyed out'? Like this: How do you make it enabled again?
david4dev
  • 4,854
  • 2
  • 28
  • 35
7
votes
1 answer

What is a 'good practice' way to write a Python GTK+ application?

I'm currently writing a PyGTK application and I'd like some advice as to the best way to structure my application. Basically the application will read a specific file specification and present it in a GUI for editing. Currently I have a parser.py…
sensae
  • 493
  • 3
  • 12
7
votes
1 answer

Localization of GUI built with Glade and Python (Gtk)

I have made an application using Glade and Python and I would like to make several localizations. I know how to localize strings that are in the Python code, I just encapsule all the strings that are supposed to be localized with _() and than…
Tomas Novotny
  • 7,547
  • 9
  • 26
  • 23
7
votes
1 answer

GtkTreeView insert/update performance penalty because of sorting

I'm having performance problems when inserting many rows into a GTK treeview (using PyGTK) - or when modifying many rows. The problem is that the model seems to get resorted after each change (insert/modification). This causes the GUI to hang for…
AndiDog
  • 68,631
  • 21
  • 159
  • 205
7
votes
3 answers

twisted + gtk: should I run GUI things in threads, or in the reactor thread?

From what I understand about twisted, nothing running in the reactor thread should block. All blocking activities should be delegated to other threads, to fire callbacks back into the reactor thread when they're done. So does this apply to gtk…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
7
votes
1 answer

Pygtk color for drag_highlight

I'm trying to change the highlight color for a gtk.EventBox. It has a certain background color, and I want to draw a line around it with its complementary color. I have found drag_highlight, which draws a line around the widget, but I have not…
zondo
  • 19,901
  • 8
  • 44
  • 83
7
votes
4 answers

How to handle a glade project with many windows

I'm working on a PyGTK/glade application that currently has 16 windows/dialogs and is about 130KB, and will eventually have around 25 windows/dialogs and be around 200KB. Currently, I'm storing all the windows in one monolithic glade file. When I…
Adam Plumb
  • 3,738
  • 8
  • 35
  • 34
7
votes
2 answers

MVC for standalone application using python, sqlite3 and gtk

I am developing a pygtk application for which I have adopted MVC structure. But I don't think I'm following the standard MVC pattern in the implementation. Please suggest how I must use MVC for the following problem statement. I am using python,…
user2109788
  • 1,266
  • 2
  • 12
  • 29
7
votes
1 answer

GtkTreeView with multiple columns and GtkListStore with single custom type (in Python)

I'm trying to display properties of an object on different columns of a Gtk.TreeView. Say I have the following: class MyClass(GObject.GObject): def __init__(self, first, last, age): self.first = first self.last = last …
jpcgt
  • 2,138
  • 2
  • 19
  • 34
7
votes
2 answers

Gtk* backend requires pygtk to be installed

From within a virtual environment, trying to load a script which uses matplotlib's GTKAgg backend, I fail with the following traceback: Traceback (most recent call last): File "", line 1, in File…
Bach
  • 6,145
  • 7
  • 36
  • 61
7
votes
1 answer

What do I have to install to resolve Could not find any typelib for GtkSource, Cannot import: GtkSourceView, cannot import name GtkSource

I'm trying to apply a patch for meld from https://bugzilla.gnome.org/show_bug.cgi?id=680569 myself, and am having trouble with this: $ git clone git://git.gnome.org/meld $ cd meld $ python setup.py build $ bin/meld 2014-01-11 16:30:44,736 ERROR…
vorburger
  • 3,439
  • 32
  • 38
7
votes
2 answers

What's the newest way to develop gnome panel applets (using python)

Today I've switched to GNOME (from XFCE) and found some of the cool stuff missing and I would like to (try to) do them on my own. I tried to find information on how to develop Gnome applets (items you place within the panel) and most likely in…
Grzegorz Oledzki
  • 23,614
  • 16
  • 68
  • 106
7
votes
3 answers

How do I deal with multiple common user interfaces?

I'm working on a python application that runs on 2 different platforms, namely regular desktop linux and Maemo 4. We use PyGTK on both platforms but on Maemo there are a bunch of little tweaks to make it look nice which are implemented as…
nikosapi
  • 71
  • 1