Is there any way to apply a frame from external module to a root window.
i have 2 files:
in
a.py
which has the line self.root = root()
and i have a function in a class which imports b.py
and
in
b.py
i have a class and instantiated a Frame to display in root window
self.frame = Frame(root)
.
There is no error but frame widget is not showing up in the root window.
I tried changing root
to self.root
in b.py file
For Example:
#file 'a'
class Root:
def __init__(self):
self.root = root()
root.title('Hello')
self.b = None
def boo(self):
import b
self.b = b.A()
Root.boo()
and
#file 'b'
class A:
def __init__(self):
self.frame = tk.LabelFrame(self.root)
self.frame.pack()
def __a_meth__(self):
Button(self.frame, text = 'YES')
Button.pack()
What changes need to be done?
question from:https://stackoverflow.com/questions/65661414/apply-frame-from-external-file-in-python-3-x