views:

62

answers:

1

HI

I have created a simple software. Now Iam trying to give a GUI to it . Since I have coded in python Iam using pygtk . I have made main window and now I want to add a pop up window ,which will become active as I press open button(already created) in main window . I have no previous experience with pygtk ..............

+5  A: 
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()

print answer

gtk dialog example

nosklo
You'll also want to destroy the dialog afterwards with `d.destroy()` otherwise it won't disappear.Also, when checking the response of the dialog, check against the built in constants (e.g. `gtk.RESPONSE_YES`).
rioch