开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜