无法在 Python Tkinter 中制作类似桌面的容器 [英] Unable to make a desktop like container in Python Tkinter

查看:26
本文介绍了无法在 Python Tkinter 中制作类似桌面的容器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在 Python 中制作一个桌面容器类型的框架,以便从菜单栏中选择窗口将在该桌面窗格中打开的选项,就像我们用来处理专业应用程序一样.

I need to make a desktop container kind of frame in Python so that from the menu bar I choose the option the window would open in that desktop pane, Like we use to deal with the Professional Applications.

这是 GUI 的快照.在快照中,上面的菜单栏也有很多级联选项.As the User choose the cascaded option, a new window should open below the Menu bar (Empty space in snap), and when the other option is chosen the previous frame should also be there and these sub frames should also have close,minimize and maximize按钮(例如 Minimize 最小化到状态栏上方框架空间的底部

Here is the Snapshot of the GUI. In the Snapshot the above Menu bar has lots of cascaded options as well. As the User choose the cascaded option, a new window should open below the Menu bar (Empty space in snap), and when the other option is chosen the previous frame should also be there and these sub frames should also have close,minimize and maximize button (e.g. Minimize Minimizes to the bottom of the frame space above the status bar

推荐答案

您正在尝试创建通常称为多文档界面"或 MDI 的内容.这在 80 年代和 90 年代初很流行,但现在普遍认为其可用性非常差.

You are trying to create what is commonly referred to as a "Multiple Document Interface", or MDI. This was popular back in the 80's and early 90's, but is now generally considered to provide very poor usability.

Tkinter 本身不支持 MDI 应用程序.您必须自己进行所有窗口管理.通常,这意味着您将为包含窗口使用画布,然后在画布中嵌入框架以表示您的窗口.您必须绘制自己的窗口边框并处理调整大小.我已经看到它完成了,但通常不值得努力实现.

Tkinter does not natively support MDI applications. You will have to do all the window management yourself. Generally this means that you'll use a canvas for the containing window, and then embed frames within the canvas to represent your windows. You'll have to draw your own window borders and handle resizing. I've seen it done, but it's usually not worth the effort to implement.

这篇关于无法在 Python Tkinter 中制作类似桌面的容器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆