pyGTK, Buttons and Pixmaps problem

Fulko van Westrenen fulko at lina.dto.tudelft.nl
Thu Nov 27 19:12:16 CET 2003


Hello,

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)
button.show()
pix,mask = gtk.create_pixmap_from_xpm(window,None,'nice.xpm')
pixmap = gtk.GtkPixmap(pix,mask)
pixmap.show()
button.add(pixmap)


Can someone tell me how to make it work?

Thanks,
Fulko


-- 
Fulko van Westrenen
fwes at lina.dto.tudelft.nl




More information about the Python-list mailing list