pyGTK, Buttons and Pixmaps problem

Fulko van Westrenen fulko at
Thu Nov 27 19:12:16 CET 2003


I use pyGTK in a program with ToggleButton and Pixmap.
The problem I try top solve is changing the pixmap for the
two states of the button. Can it be done? (should be possible),
and someone provide me with working code?

The code I use now is (python-2.2, gtk-1.2):

button = gtk.GtkToggleButton()
button.connect("clicked", do_my_thing)
pix,mask = gtk.create_pixmap_from_xpm(window,None,'nice.xpm')
pixmap = gtk.GtkPixmap(pix,mask)

Can someone tell me how to make it work?


Fulko van Westrenen
fwes at

More information about the Python-list mailing list