本文整理汇总了Python中gazpacho.gadget.Gadget.get_prop方法的典型用法代码示例。如果您正苦于以下问题:Python Gadget.get_prop方法的具体用法?Python Gadget.get_prop怎么用?Python Gadget.get_prop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gazpacho.gadget.Gadget
的用法示例。
在下文中一共展示了Gadget.get_prop方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _create_box
# 需要导入模块: from gazpacho.gadget import Gadget [as 别名]
# 或者: from gazpacho.gadget.Gadget import get_prop [as 别名]
def _create_box(self, gtk_source, gtk_target, location):
"""
Create a Box containing the widgets.
@param gtk_source: the gtk widget to add
@type gtk_source: gtk.Gadget
@param gtk_target: the gtk widget to replace
@type gtk_target: gtk.Gadget
@param location: Where to put the source in relation to the target
@type location: (constant value)
"""
from gazpacho.dndhandlers import DND_POS_TOP, DND_POS_BOTTOM, \
DND_POS_LEFT
# Create a Box with size 2
if location in [DND_POS_TOP, DND_POS_BOTTOM]:
box_type = 'GtkVBox'
else:
box_type = 'GtkHBox'
adaptor = widget_registry.get_by_name(box_type)
box_gadget = Gadget(adaptor, self._project)
box_gadget.create_widget(interactive=False)
box_gadget.get_prop('size').set(2)
# Add the source and target widgets
children = box_gadget.widget.get_children()
if location in [DND_POS_TOP, DND_POS_LEFT]:
source_placeholder, target_placeholder = children[0], children[1]
else:
source_placeholder, target_placeholder = children[1], children[0]
Gadget.replace(source_placeholder, gtk_source, box_gadget)
Gadget.replace(target_placeholder, gtk_target, box_gadget)
return box_gadget.widget