Advertisement
Guest User

Untitled

a guest
Oct 20th, 2013
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #!/usr/bin/python2
  2.  
  3. import pygtk
  4. import gtk
  5. pygtk.require('2.0')
  6.  
  7. class Base:
  8. def hola(self, widget, data="None"):
  9. print "hola"
  10.  
  11. def cerrar_aplicacion(self, widget):
  12. print "se ha cerrado la aplicacion"
  13. gtk.main_quit()
  14.  
  15. def __init__(self):
  16.  
  17. self.w = gtk.Window(gtk.WINDOW_TOPLEVEL)
  18. self.w.connect("destroy", self.cerrar_aplicacion)
  19. self.w.set_title("Ventana de prueba")
  20. self.w.set_border_width(15)
  21.  
  22. self.button=gtk.Button("presiona aqui")
  23. self.button.connect("clicked", self.hola)
  24.  
  25. self.w.add(self.button)
  26.  
  27. self.w.show()
  28. self.button.show()
  29.  
  30. def principal(self):
  31. gtk.main()
  32.  
  33. if __name__ == "__main__":
  34. base = Base()
  35. base.principal()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement