You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UIViewTKinter.py 1.0KB

123456789101112131415161718192021222324252627282930313233343536
  1. try:
  2. from Tkinter import *
  3. except ImportError:
  4. from tkinter import *
  5. from UIController import *
  6. class View(Tk):
  7. def __init__(self, c, *args, **kwargs):
  8. Tk.__init__(self, *args, **kwargs)
  9. self.controller = c
  10. self.title("Taktiles Spelling")
  11. #self.resizable(height=False, width= False)
  12. self.geometry('{}x{}'.format(460,350))
  13. #self.configure(bg="blue")
  14. topFrame = Frame(self, bg="white", height=10, width=450) #, padx=460, pady=10)
  15. l = Label(topFrame, text="Titel")
  16. b = Button(topFrame, text="test")
  17. topFrame.pack()
  18. l.grid(row=0, column=0)
  19. b.grid(row=0, column=1)
  20. testBtn = Button(self, text="test", command=lambda: self.controller.actionPerformed("test"))
  21. testBtn.pack()
  22. stopBtn = Button(self, text="stop", command=lambda: self.controller.actionPerformed("stop"))
  23. stopBtn.pack()
  24. self.protocol("WM_DELETE_WINDOW", self.onClosing)
  25. def onClosing(self):
  26. print("closing")
  27. self.destroy()