In this post, we will see how to resolve Object oriented constructor for Toplevel class (no side-effects)
Question:I’m having trouble writing the constructor for a class that inherits from tkinter’s Toplevel dialog. I’m calling it from another class that itself inherits from Frame. The problem I’m getting is a funny side-effect with the code I’ve come up with. I get an extra instance of the the calling Frame when the Toplevel dialog gets instantiated. I just wanted to ask if somebody could point me in the right direction on how to call super in the constructor for a custom Toplevel class. This inside a Python framework. The entire code I currently have follows:
Best Answer:Thanks for all the help, I was having difficulties applying the knowledge I have of objects in Java to the Python/Tk paradigm. It all seems to work fine now. The updated listing follows.
If you have better answer, please add a comment about this, thank you!