Can you change a widget#39;s parent in python tkinter?(你可以在 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.
干杯,克里斯
推荐答案
An 旧帖 byFredrik 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 中更改小部件的父级吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:你可以在 python tkinter 中更改小部件的父级吗?


- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 我如何透明地重定向一个Python导入? 2022-01-01