Was watching a tutorial on youtube on how to use OOP in building GUI, but can not run identical code myself.
Error: "in line 27 app = Application() TypeError: __init__() missing 1 required positional argument: 'master'"
anybody could explain? Thank you!
Error: "in line 27 app = Application() TypeError: __init__() missing 1 required positional argument: 'master'"
anybody could explain? Thank you!
from tkinter import *
class Application(Frame):
def __init__(self, master):
Frame.__init__(self.master)
self.grid()
self.create_widgets()
def create_widgets(self):
self.button1 = Button(self, text ="1")
self.button1.grid()
self.button2 = Button(self)
self.button2.grid()
self.button2.configure(text = "This will show up text")
self.button3 = Button(self)
self.button3.grid()
self.button3["text"] = "This will also show text"
root = Tk()
root.title("Lazy Buttons")
root.geometry("200x85")
app = Application()
app.create_widgets()
root.mainloop()
