1  #!/usr/bin/python
 2
 3  import gtk
 4
 5  def do_exit (window):
 6          gtk.main_quit ()
 7
 8  def do_click (button):
 9          gtk.gdk.beep ()                 # beep at the user
10
11  window = gtk.Window ()
12  button = gtk.Button (stock=gtk.STOCK_YES)       # create a "Button" from stock
13
14  window.add (button)
15
16  button.connect ("clicked", do_click)    # handle the "clicked" signal with the
17                                          # do_click() call
18
19  window.connect ("destroy", do_exit)     # handle the "destroy" signal with the
20                                          # do_exit() call
21
22  window.show_all ()
23
24  gtk.main ()