I was searching, but I couldn't find an equivalent of JDesktopPane and Java JinternalFrame in Python, I need to pass a java program which has these widgets to Python, but for now I haven't found an alternative to do it. What is the equivalent of these widgets for Python?
I don't know anything about Java, however I googled what both widgets are about. Unfortunately, there is no equivalent in Tkinter. However, I offer you 3 alternatives.
Alternative 1: Top level
This is the closest thing that exists within Tkinter.
You can use a Toplevel , which would be like a separate window, but if you close the parent window, the Toplevel is also closed.
You can apply the .transient() method to make the toplevel always drawn over its parent window and if the parent window is minimized, so is this window. This has the disadvantage that the window you create can only be closed, not maximized or minimized.
You can make a Toplevel behave similar (not the same) as a transient window with this code:
This would allow you to have a trasient window that can be maximized.
Alternative 2: ttk.Notebook
Instead of creating windows, you could display specific things based on a tabbed option. The widget that does this job is called ttk.Notebook .
Alternative 3: Do it yourself
You can create the JInternalFrame widget yourself using the magical Frame widget . This is the most complex alternative of the 3 and the only one compatible with what I consider to be a kind of JDesktopPane. From what I understood, a JDesktopPane is a zone that the JInternalFrame is in but cannot move out of it.
I myself took the trouble to create a basic widget that can serve your purpose :). This imitation of JInternalFrame has all the methods of a Frame plus others that I take care of explaining within the code.
Any style you want to give it, function or improvement is homework ;)
I recommend you use alternative 1 or 2 as these things are already done and probably better designed than my code in alternative 3. Just out of curiosity, was my answer helpful? Which of the 3 alternatives will you choose if it was so?