Search code examples
pythonlinuxpygtk

How to create a pop window using pygtk?


Todo:

On button click in main window, open a popup dialog

Framework:

pygtk

Experience:

Beginner


Solution

  • 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