PyGTK

From Wikipedia, the free encyclopedia

Screenshot of WingIDE which is written using PyGTK. More screenshots
Enlarge
Screenshot of WingIDE which is written using PyGTK. More screenshots

PyGTK is a set of Python wrappers for the GTK+ GUI library. PyGTK is free software and licensed under the LGPL. Its original author is the famous GNOME developer James Henstridge. Today there are six people in the core development team, with various other people who have submitted patches and bug reports. PyGTK has been selected as the environment of choice for applications running on the One Laptop Per Child systems. Developers and interested parties can usually be found on the IRC channel #pygtk on irc.gnome.org.

PyGTK has been used in a number of notable applications, some examples:

[edit] Example: Hello World in PyGTK

import gtk

def button_pressed_cb(button):
    print "Hello again - the button was pressed"

window = gtk.Window()
window.set_title("Hello World!")
button = gtk.Button("Press me")
button.connect("clicked", button_pressed_cb)
window.add(button)
window.show_all()
gtk.main()

The sample program creates a GTK+ Window titled "Hello World!". The window contains a Button labelled "Press me." When the button is pressed, the message "Hello again - the button was pressed" is displayed on the console via the callback button_pressed_cb.

[edit] External links