Replace Image Using Gtk.image.set_from_file
I'm trying to add and if needed by user, change the image from a widget in python. I'm using Glade with gtk2+, python 2.7.3, and these is what I'm doing image = gtk.Image() image.
Solution 1:
You either have to remove the old image from the button before adding a new one (the error message is pretty straightforward about this), or you could try changing the current image:
button.get_child().set_from_file("MyImagePath.png")
Post a Comment for "Replace Image Using Gtk.image.set_from_file"