Created
October 21, 2020 07:39
-
-
Save tormath1/03358fa33d79a0828e648623278b9781 to your computer and use it in GitHub Desktop.
simple tkinter frame with inheritance
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter | |
class Test(tkinter.Frame): | |
def __init__(self, parent): | |
tkinter.Frame.__init__(self, parent) | |
# create entry class attribute | |
self.entry = tkinter.Entry(self) | |
self.entry.grid(row=0, column=1) | |
def set_myvar(self): | |
self.var = "new hello world" | |
# main program | |
root = tkinter.Tk() | |
frame = Test(root) | |
frame.pack() | |
root.mainloop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment