In PyGTK, what's a good way of displaying an image in a GUI?
I have a PyGTK GUI that has a gtk.Table.
Pressing one button will generate a PNG file.
I can show the PNG file in the GUI by adding it somewhere in the table and calling the main window's show_all method again.
Is there a better way? What if I want to show more th开发者_StackOverflow中文版an one PNG file at a time?
You can use a combination of gtk.Image, gtk.HBox (or VBox), and maybe gtk.ScrolledWindow if you plan on showing a lot of images. Just create a new gtk.Image, set the image using set_from_file
, then call pack_end
on the box to display it.
精彩评论