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

Creating Segments in Video

I'm using Python 2.7, PyGTK 2.24, and PyGST (Gstreamer). To ensure smooth playback from one clip to another (without a blink), I combined all the clips I needed into one larger video. This lets me seek to the exact place I need in code. One of the…
CodeMouse92
  • 6,840
  • 14
  • 73
  • 130
6
votes
3 answers

How do you attach a popup menu to a column header button in GTK2 using PyGObject?

I want to popup a context menu when the user right-clicks on the header row of a Gtk.TreeView. In GTK3, Gtk.TreeViewColumn has a get_button() method, which makes this easy; simply attach the menu to the button and connect it to a 'clicked' event.…
user626998
6
votes
1 answer

How to make the last gtk.TreeViewColumn resizeable?

One can use gtk.TreeViewColumn.set_resizable(True) to make column manually resizeable... except the last column -- it always occupies the available space. While it's sensible in most cases, I use TreeView-in-a-ScrolledView, and I'd like to be able…
Andrey Paramonov
  • 409
  • 4
  • 11
6
votes
3 answers

Custom objects in ListStore/TreeStore

I have a list L of objects of my class A. This class implements __str__/__repr__, so each object has it's own string representation (not necessary unique). I have a GUI in pygtk, where I have a TreeView widget with only one column. I want to…
6
votes
4 answers

#!/usr/bin/env python: Getting command not found and Permission Denied

I have at the top of the file #!/usr/bin/env python. So it should work when I run the file? But it doesnt. It works when I use python file.py tho #!/usr/bin/env python import pygtk pygtk.require('2.0') import gtk class App1: def…
Jiew Meng
  • 84,767
  • 185
  • 495
  • 805
6
votes
3 answers

How to compile all resources into one executable file?

I've wrote GTK application with python. All graphical user interface is in glade file, and there are some images used. I wish to compile my application into EXEcutable file. For that I'm using PyInstaller compiler and UPX packer. I've done as manual…
Lixas
  • 6,938
  • 2
  • 25
  • 42
6
votes
0 answers

An up to date Quickly(ubuntu) Guide

Does anyone know of an up to date guide for Quickly, it has changed a lot since I have lasted used it. I'm trying to link a button to an function. I believe all you need to do is name the function in a special way…
Samuel Taylor
  • 1,181
  • 2
  • 14
  • 25
6
votes
1 answer

Pygtk: Change a widget's border color

I have looked everywhere but couldn't seem to find a way to change the color of the border. For example I need a button like this: gb = gtk.Button("Hi") gb.set_border_width(50) Now I wish to color the border red (this is a non-existent…
Eric Chen
  • 3,562
  • 7
  • 39
  • 58
6
votes
2 answers

PyGTK set icon of window with stock image

I feel like this should be pretty simple, but I guess I am missing something. So I want to set the icon of a window with one of the stock images. I have tried: windowIcon = gtk.image_new_form_stock(gtk.STOCK_DIALOG_AUTHENTICATION,…
Kevin S
  • 2,713
  • 24
  • 31
6
votes
1 answer

How to set the color of a single cell in a pygtk treeview?

I have a PyGtk treeview with a couple of columns. During runtime i add constantly new rows. Each cell contains a string. Normaly, i would use a gtk.CellRenderer for each row, but I want to set the background color of each cell, according to the…
Fookatchu
  • 7,125
  • 5
  • 28
  • 26
6
votes
2 answers

Finding the workspace size (screen size less the taskbar) using GTK

How do you create a main window that fills the entire desktop without covering (or being covered by) the task bar and without being maximized? I can find the entire screen size with and set the main window accordingly with this: window =…
Stacey Richards
  • 6,536
  • 7
  • 38
  • 40
6
votes
3 answers

Automatic image scaling on resize with (Py)GTK

I have a GtkImage widget in a resizable window and a reference GdkPixBuf storing the image I want to fill the GtkImage with. I can scale the GdkPixBuf to fill the GtkImage widget using this method: def update_image(self, widget=None, data=None): …
Jim
  • 530
  • 6
  • 15
6
votes
2 answers

How to get transparent background in window with PyGTK and PyCairo?

I've been trying really hard to create a window with no decoration and a transparent background using PyGTK. I would then draw the content of the window with Cairo. But I can't get it to work. I've tried a lot of different ways, they all failed,…
paldepind
  • 4,680
  • 3
  • 31
  • 36
6
votes
5 answers

Beginner-level Python threading problems

As someone new to GUI development in Python (with pyGTK), I've just started learning about threading. To test out my skills, I've written a simple little GTK interface with a start/stop button. The goal is that when it is clicked, a thread starts…
crashsystems
  • 175
  • 2
  • 8
  • 15
6
votes
2 answers

How to find shared library used by a python module?

I am debugging a python program based on pygtk and I want to make sure that the program is using the right shared library. pygtk is a GTK+ wrapper for python. I have already compiled GTK+ using jhbuild tool and I want to make sure that the python…
mehdix
  • 4,984
  • 1
  • 28
  • 36