Posted By

buscarini on 07/14/06


Tagged

gui desarrollo


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

yuconner
anayhk


Interfaz simple de ventana con 2 botones


 / Published in: Python
 

  1. from Tkinter import *
  2.  
  3. class App:
  4. def __init__(self,master):
  5.  
  6. frame = Frame(master)
  7. frame.pack()
  8.  
  9. self.button = Button(frame,text = "QUIT",fg = "red", command=frame.quit)
  10. self.button.pack(side=LEFT)
  11.  
  12. self.hi_there = Button(frame,text="Hello",command=self.say_hi)
  13. self.hi_there.pack(side=LEFT)
  14.  
  15. def say_hi(self):
  16. print("hi there, everyone!")
  17.  
  18. root = Tk()
  19.  
  20. app = App(root)
  21.  
  22. root.mainloop()

Report this snippet  

You need to login to post a comment.