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

Bundling GTK resources with py2exe

I'm using Python 2.6 and PyGTK 2.22.6 from the all-in-one installer on Windows XP, trying to build a single-file executable (via py2exe) for my app. My problem is that when I run my app as a script (ie. not built into an .exe file, just as a loose…
detly
  • 29,332
  • 18
  • 93
  • 152
10
votes
1 answer

How to show column headers in a GtkTreeView inside a gtk.ScrolledWindow?

I have a problem with Gtk.Treeview indide a Gtk.ScrolledWindow. I have a large amount of data, which doesnt fit inside my normal window geometrics, so i put my Treeview inside a ScrolledWindow, which seems to be the normal way. The problem with this…
Fookatchu
  • 7,125
  • 5
  • 28
  • 26
10
votes
1 answer

Right Click Menu (context menu) using PyGTK

So I'm still fairly new to Python, and have been learning for a couple months, but one thing I'm trying to figure out is say you have a basic window... #!/usr/bin/env python import sys, os import pygtk, gtk, gobject class app: def…
Michael Schwartz
  • 8,153
  • 14
  • 81
  • 144
10
votes
3 answers

PyGTK: How do I make an image automatically scale to fit its parent widget?

I have a PyGTK app that needs to load an image of unknown size, however I am having the problem that if the image is either very big or very small, the window layout becomes distorted and hard to use. I need some way of making the image…
Zaz
  • 46,476
  • 14
  • 84
  • 101
10
votes
4 answers

Is there a way to uncheck all radio buttons in a group? (PyGTK)

Is there a way to uncheck all radio buttons in a group with PyGTK? No radio buttons are checked on startup, so I think there must be a way to return them all to that unchecked state.
linkmaster03
  • 4,038
  • 6
  • 25
  • 22
10
votes
3 answers

Python classes losing attributes

I have a peculiar python problem. During the course of execution of my gtk python application, some of my class objects mysteriously lose attributes, causing some of the functionality of my program to break. It's hard to give a sense of why this…
jsj
  • 9,019
  • 17
  • 58
  • 103
10
votes
1 answer

In GTK, how do I get the actual size of a widget on screen?

First I looked at the get_size_request method. The docs there end with: To get the size a widget will actually use, call the size_request() instead of this method. I look at size_request(), and it ends with Also remember that the size request is…
Claudiu
  • 224,032
  • 165
  • 485
  • 680
10
votes
1 answer

How to apply theme to PyGTK Application

Is it possible to apply this GTK+ theme in my PyGTK application? Can I apply the theme programatically? Ie, to apply the theme do I use a PyGTK function or do I have to find where PyGTK is installed on my machine(Inside Python2.7) and change the…
sazr
  • 24,984
  • 66
  • 194
  • 362
9
votes
5 answers

putting glade interface in python

I've made a gui in glade that I want to put in a python program. I was adapting the instructions from a tutorial I found online to load in my glade file (http://www.pygtk.org/articles/pygtk-glade-gui/Creating_a_GUI_using_PyGTK_and_Glade.htm). When I…
Bianca
  • 283
  • 1
  • 4
  • 15
9
votes
3 answers

Mysterious GObject warning: assertion `G_IS_OBJECT (object)' failed

I have a warning when I run my GTK (Python GObject introspection) application and I can't figure out its source. When the application is loading and I'm populating a GtkListStore, after the very first time I append a row, I get the following…
user626998
9
votes
3 answers

Programmatically close gtk window

If you have a sub-window in GTK and you want to close it programmatically (e.g., pressing a save button or the escape key), is there a preferred way to close the window? E.g., window.destroy() # versus window.emit('delete-event')
Uyghur Lives Matter
  • 18,820
  • 42
  • 108
  • 144
9
votes
3 answers

Pygtk: Remove a widget from a container and reuse it later

I'm using a custom container where I need to reorder widgets but there are no methods to do it. So I tried to remove all the widgets and add them again in order. The problem is that this is not working well, I can't see the widgets after adding them…
pmoleri
  • 4,238
  • 1
  • 15
  • 25
9
votes
4 answers

How to install pygtk 3 on Mac OS X?

What I tried: brew install pygobject3 --with-python@2 gtk+3 brew install pygtk3 brew install pygobject3 pip install pygobject python -c 'import gi; gi.require_version("Gtk", "3.0")' Result: ValueError: Namespace Gtk not available for version…
Hugh Perkins
  • 7,975
  • 7
  • 63
  • 71
9
votes
5 answers

Progress bar not updating during operation

in my python program to upload a file to the internet, im using a GTK progress bar to show the upload progress. But the problems that im facing is that the progress bar does not show any activity until the upload is complete, and then it abruptly…
Pranav
  • 3,340
  • 8
  • 35
  • 48
9
votes
1 answer

Resizing gtk TreeView in HPaned problem

I have a treeview in the left side of an hpaned but when I try to move the bar to the left to make the treeview smaller than its automatic size instead of resizing the treeview it expands the entire program window to the right. Any ideas on how to…
njvb
  • 1,377
  • 3
  • 18
  • 36