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
8
votes
2 answers

Working around a big memory leak in GTK when redrawing a label

I'm using the latest release of the PyGTK All-in-One installer (2.24.2) for Python 2.7 which includes Cairo 1.10.8, Pango 1.29.4, PyGTK 2.24.0, and PyGobject 2.28.3 (I think). The following code leaks ~55 MB of memory: import gtk window =…
Steven T. Snyder
  • 5,847
  • 4
  • 27
  • 58
8
votes
1 answer

Showing a gtk.Calendar in a menu?

I want to construct a context menu with a menu item for selecting a date. (The use case is selecting a bunch of items in a treeview and then setting a new due date for all the items.) Since a menuitem is a Gtk.Bin, I can specify any widget in…
bryce
  • 468
  • 5
  • 23
8
votes
9 answers

Pure python gui library?

Python has a lot of GUI libraries: tkinter, wxWidgets, pyGTK etc. But all these GUIs need to be installed and quite heavyweight, so it's a bit complex to deploy end-user GUI python apps that relay on mentioned GUI libraries. Recently, I have thought…
grigoryvp
  • 40,413
  • 64
  • 174
  • 277
8
votes
4 answers

PHP desktop applications

I have quite a few years experience of developing PHP web applications, and have recently started to delve into Python as well. Recently I've been interested in getting into desktop applications as well, but have absolutely no experience in that…
Christwo
  • 647
  • 2
  • 7
  • 10
7
votes
1 answer

How to debug PYGTK program

When python raise an exception in the middle of a pygtk signal handling callback, the exception is catched by the gtk main loop, its value printed and the main loop just continue, ignoring it. If you want to debug, with something like pdb (python -m…
Guillaum
7
votes
1 answer

Check if window is on the current desktop?

How do I check that a pygtk Window is on the current desktop? A program I'm fixing has: if self.pymp.window.get_property('visible'): self.pymp.window.hide() else: self.pymp.window.move(self.pymp.position[0], self.pymp.position[1]) …
Dan D.
  • 73,243
  • 15
  • 104
  • 123
7
votes
3 answers

How do I raise a window that is minimized or covered with PyGObject?

I'd been using the answer provided in the PyGTK FAQ, but that doesn't seem to work with PyGObject. For your convenience, here is a test case that works with PyGTK, and then a translated version that doesn't work with PyGObject. PyGTK Version: import…
dumbmatter
  • 9,351
  • 7
  • 41
  • 80
7
votes
1 answer

Creating a screenshot of a gtk.Window

For testing and documentation purposes I would like to create a screenshot of a gtk.Window object. I'm following a basic pygtk sample at the moment. The example with my modifications looks like the following: import gtk def main(): button =…
Michael Mulich
  • 1,240
  • 14
  • 21
7
votes
3 answers

How do I create a new signal in pygtk

I've created a python object, but I want to send signals on it. I made it inherit from gobject.GObject, but there doesn't seem to be any way to create a new signal on my object.
clahey
  • 4,795
  • 3
  • 27
  • 20
7
votes
2 answers

Learning GUI programming with GTK+2 or GTK+3?

I am new to GUI programming, and I haven't found yet what library is best for my purpose (i want to make desktop environment applications, eg. docks, panels, desklets etc.) I have started learning basics of GTK, mainly using PyGtk. Most tutorials i…
neydroydrec
  • 6,973
  • 9
  • 57
  • 89
7
votes
1 answer

Take screenshots at fixed intervals with Python using threading.Timer

I'm writing a simple GUI application with pyGTK to take desktop screenshots at fixed intervals. To schedule the shots I use the threading.Timer class and to take shots I use os.system calls to scrot. When I click the start taking screenshots button…
David Saltares
  • 808
  • 2
  • 11
  • 19
7
votes
1 answer

Getting Matplotlib's GTK Agg backend to respect user theming

I'm writing a PyGTK/Twisted app that uses Matplotlib for graphing. It's easy enough to embed the plots in my widgets using the FigureCanvasGtkAgg, but I notice that the background colour of the canvas (outside the plot area itself) does not match…
detly
  • 29,332
  • 18
  • 93
  • 152
7
votes
2 answers

Putting other widgets in gtk.Menu

I'd like to be able to put a gtk.ProgressBar in my gtk.Menu, but since menus only takes gtk.MenuItems and its subclasses, what I've done instead is take a plain gtk.MenuItem and tried adding my progress bar as a child to that. Since gtk.MenuItem is…
Tommy Brunn
  • 2,520
  • 2
  • 29
  • 41
7
votes
5 answers

Setting up developement environment: PyCharm, python-gtk, windows

I want to develop with these tools: MS-Windows 10 Python3 gtk PyCharm I installed PyCharm, but up to now Python and gtk are not installed up to now. Sub questions: use 32 or 64 Bit version of Python? How to install gtk for python (pip or…
guettli
  • 25,042
  • 81
  • 346
  • 663
7
votes
1 answer

Get color scheme from GTK

I am developing a desktop app using Python 3 and GTK3. I need a button to change its background color when hover, which can be done with this: self.uploadbutton.modify_bg(Gtk.StateType.PRELIGHT, self.color) Until now, I defined a RGB color that…
CarlosMorente
  • 775
  • 1
  • 7
  • 17