本文整理匯總了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