draw a window inside another

后端 未结 1 679
野性不改
野性不改 2021-01-15 08:40

I wanted to ask if it is possible to draw a child window inside a parent window so that it will only be able to move inside the parent window and won\'t be able to move out

相关标签:
1条回答
  • 2021-01-15 09:30

    If you mean having actual windows with title bar, menu, status bar etc. inside the parent window then the answer is: No, Tcl/Tk and by extension Tkinter does not support this with its standard widgets.

    There have been efforts in the past to implement widgets which emulate MDI as you can see on the TCL wiki, but most of them are over a decade old. You will probably have to implement it yourself or choose a different GUI toolkit if you really need to implement this kind of UI design.

    If you do it yourself, you can use the Frame widget as the subwindow, and use place to put it in the containing window. Or, you can create it as an object on a canvas. You'll have to write all of the code to give the inner window borders and a title bar, and to manage moving it around, iconifying it, etc.

    0 讨论(0)
提交回复
热议问题