将小部件附加到网格后如何获取附件值 [英] How to get the attachment values when a widget has been attached to a grid
本文介绍了将小部件附加到网格后如何获取附件值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
This will show all attributes and their values of an existing widget: (I got the idea from user285594 at this post)
obj = [widget identifier]
for pspec in obj.props:
print(pspec.name)
name = pspec.name.replace('-', '_')
props = eval("button.props." + name)
print(props)
不幸的是,当小部件已附加到网格时,我找不到附件值.有人知道该怎么做吗?
Unfortunately, I can't find the attachment values when the widget has been attached to a grid. Does anyone know how to do this?
推荐答案
附件和打包值为子属性,而不是属性,因此您必须使用
The attachment and packing values are child properties, not properties, so you have to retrieve them with child_get_property()
.
这篇关于将小部件附加到网格后如何获取附件值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文