如何使用pygtk创建一个弹出窗口?

时间:2010-07-07 11:59:04

标签: python linux pygtk

TODO:

On button click in main window, open a popup dialog

框架:

pygtk

体验:

初​​级

1 个答案:

答案 0 :(得分:6)

import gtk

d = gtk.Dialog()
d.add_buttons(gtk.STOCK_YES, 1, gtk.STOCK_NO, 2)

label = gtk.Label('Do you like GTK?')
label.show()
d.vbox.pack_start(label)

answer = d.run()
d.destroy()

print answer

gtk dialog example