您可以在python tkinter中更改小部件的父级吗? [英] Can you change a widget's parent in python tkinter?

查看:91
本文介绍了您可以在python tkinter中更改小部件的父级吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改小部件的父级(在这种情况下为ttk.frame)?我在小组件 .config 中找不到要使用的关键字.这在python tkinter中是不可能的吗?我在功能上想要的是将当前框架放入tkk.notebook小部件中,当我双击选项卡时,要使所有内容都位于选项卡的框架中,请移至其自己的单独的TopLevel窗口.这样,用户在处理另一个选项卡时就可以直观地看到该选项卡.没有我要问的框架功能,我想不出任何其他方式来实现这一目标.也许如果有人可以解决这个问题,那么我就不必担心父级窗口小部件功能.

Is there any way to change a widget's (ttk.frame in this case) parent? I can't find any keywords to use in the widgets .config. Is this not possible in python tkinter? What I'd like functionally is to take my current frame in my tkk.notebook widget, and when I double click the tab, to have everything in the frame of the tab, move to it's own separate TopLevel window. This way the user can have a visual reference to that tab while working on another tab. I couldn't think of any other way to have this happen without the frame functionality I'm asking about. Perhaps if anyone can circumvent this issue, I won't need to worry about parent widget capabilities.

干杯, 克里斯

推荐答案

旧帖子由Fredrik Lundh(Tkinter的作者)建议不可能更改小部件的父级.

An old post by Fredrik Lundh (the Tkinter author) suggests that it isn't possible to change a widget's parent.

这篇关于您可以在python tkinter中更改小部件的父级吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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