Sep-28-2022, 05:46 AM
(Sep-27-2022, 03:49 PM)deanhystad Wrote: Just a small change to make a much better better solution:
class CustomFrames(tk.Frame): def __init__(self, parent, name, *args, **kwargs): super().__init__(parent, *args, **kwargs) parent.add(self, text=name) frame01Start=CustomFrames(notebook1, "Start")Your frame class should not have to know about frame01Start and the tab name should not be limited to "Start". These should be passed as arguments to the __init__() method.
*args and **kwargs allow passing additional arguments to Frame.__init__(). CustomFrames doesn't have to know anything about these arguments, it just passes them along to the Frame.__init__() method.
perfect. Thank you!