class SettingsFrame(tk.Frame):
"""docstring for SettingsFrame"""
def __init__(self, master):
self.master = master
self = tk.Frame(self.master)
self.url_label = tk.Label(self, text="Product URL")
self.url_label.pack(side="left")
self.url_entry = tk.Entry(self)
self.url_entry.pack(side="left")
class Application(tk.Frame):
def __init__(self, master=None):
super().__init__(master)
self.master = master
self.pack()
self.settings_frame = SettingsFrame(self)
self.settings_frame.pack(side="top")
def main():
root = tk.Tk()
app = Application(master=root)
app.mainloop()
if __name__ == "__main__":
main()
I'm tryining to structure my code as suggested in this answer - https://stackoverflow.com/a/17470842/12355344, but I'm not sure how to correctly pack() this SettingsFrame
with label and entry into Application
class.
AttributeError: 'SettingsFrame' object has no attribute 'tk'