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

GTK and PYGTK difference

many programmers import both gtk and pygtk in this way: import gtk import pygtk I have created a simple program using only gtk and it works: import gtk window = gtk.Window() window.set_size_request(800,…
xRobot
  • 25,579
  • 69
  • 184
  • 304
21
votes
4 answers

Modern GUI programming in Python 3.3

I am putting together a few programs, and it's about time to start making GUI's for some of them. The code is currently written in Python 3.3. I have researched a few GUI's for Python, namely Tkinter, wxPython and PyGTK. Everything I am finding…
Tennesseej
  • 399
  • 2
  • 3
  • 11
20
votes
4 answers

How to install poppler in ubuntu 15.04?

Poppler is a PDF rendering library based on the xpdf-3.0 code base. I have already downloaded the tar.xz file from the official site http://poppler.freedesktop.org/ But I do not know what to do with this file Is there any command to install or…
18
votes
2 answers

Enable or disable gtk.Button in PyGTK

How can I set a gtk.Button enabled or disabled in PyGTK?
0xAX
  • 20,957
  • 26
  • 117
  • 206
18
votes
3 answers

How can I determine the display idle time from Python in Windows, Linux, and MacOS?

I would like to know how long it's been since the user last hit a key or moved the mouse - not just in my application, but on the whole "computer" (i.e. display), in order to guess whether they're still at the computer and able to observe…
Glyph
  • 31,152
  • 11
  • 87
  • 129
16
votes
1 answer

How to get value from selected item in treeview in PyGTK?

I'm learning PyGtk. I have a simple treeview with 1 column, I get items for that treeview from list. How to get value of selected item in treeview?
shiii
  • 175
  • 1
  • 1
  • 5
16
votes
4 answers

How to make GtkTextView look like GtkEntry?

Or "How to add a visible (thin) border to GtkTextView"? Is it ever possible? Thank you in advance.
Paulo Freitas
  • 13,194
  • 14
  • 74
  • 96
16
votes
2 answers

authentication in python script to run as root

I am doing a project in Linux at system level in Python. So that, I want to know that if i am running my code as a normal user and if i am accessing system files then it should have root permissions for it, then how can i prompt for root password…
user636424
15
votes
2 answers

Python AppIndicator bindings -> howto check if the menu is open?

Here is a minimal example of an AppIndicator: #!/usr/bin/python import gobject import gtk import appindicator if __name__ == "__main__": ind = appindicator.Indicator("example-simple-client", "gtk-execute",…
con-f-use
  • 3,772
  • 5
  • 39
  • 60
15
votes
4 answers

I'm completly confused with PyObject, PyGTK and GNOME 3 as well

I installed Fedora 15 to use Python3 and GObject to develop a desktop-application, because PyGTK looks outdated: PyGTK 2.24.0 released Friday 01 April 2011 by Rafael Villar Burke PyGTK 2.24.0 has been released. This is a stable release…
quantez
  • 191
  • 1
  • 1
  • 4
15
votes
4 answers

ImportError: No module named gi.repository Mac OS X

I am installing virt-manager0.10.0 on Mac OS X First I installed python,libvirt, gtk+3, pygtk, and other dependencies with homebrew But when I run virt-manager I got this error from gi.repository import GObject ImportError: No module named…
MKT
  • 655
  • 1
  • 6
  • 18
15
votes
2 answers

How to have drag-and-drop and sorted GtkTreeView in GTK3?

I am porting liblarch, a library for handling directed acyclic graphs, from PyGTK (GTK2) to PyGObject introspection (GTK3). I ran into the problem with GtkTreeView. The app using liblarch needs to sort GtkTreeView by a column but in the same time,…
izidor
  • 4,068
  • 5
  • 33
  • 43
14
votes
2 answers

Python - Separate program logic and GUI code?

What would be the best way of separating program logic to the GUI code? I wanted different GUI (GTK, KDE, CLI) code using the same program logic. I was thinking of using different python module (winecellar-common, winecellar-gtk, winecellar-cli) not…
Samuel Taylor
  • 1,181
  • 2
  • 14
  • 25
14
votes
5 answers

Creating GUI with Python in Linux

Quick question. I'm using Linux and I want to try making a GUI with Python. I've heard about something like Qt, GTK+ and PyGTK but I don't know what they are exactly and what the difference between them is. Is there any difference on how they work…
Iceland_jack
  • 6,848
  • 7
  • 37
  • 46
13
votes
2 answers

How to draw any GTK widget on top of Cairo surface

I would like to save the looks of a GTK window, and all the buttons and other widgets it contains to a PNG or PDF file. Cairo supports drawing on such surfaces. Could I somehow ask a GTK widget to draw itself on Cairo surface? A code sample would…
tzador
  • 2,535
  • 4
  • 31
  • 37