Just starting to get the idea of MVC with tkinter. I wrote this simple program and I'm looking for feedback. There are no errors, but I don't know if I set it up right or not.
import tkinter as tk
class Model():
def __init__(self):
self.list = ["email", "sms", 'voice']
class View(tk.Frame):
def __init__(self, parent, controller):
self.controller = controller
tk.Frame.__init__(self, parent, bg="yellow", bd=2,
relief=tk.RIDGE)
self.parent = parent
self.pack()
self.labelVariable=tk.StringVar()
self.output=tk.Label(self, textvariable=self.labelVariable,
bg="orange", fg="white")
self.output.pack()
self.hello = tk.Button(self, text="Show", command=
self.controller.hello_Button_Pressed, bd=2,
relief=tk.RIDGE)
self.hello.pack(side="left")
class Controller():
def __init__(self):
self.root = tk.Tk()
self.model = Model()
self.view = View(self.root, self)
self.root.title("MVC example")
self.root.geometry("250x350")
self.root.config(background="LightBlue4")
self.root.mainloop()
def hello_Button_Pressed(self):
self.view.labelVariable.set(self.model.list)
if __name__ == '__main__':
c = Controller()