本文整理汇总了Python中horizons.gui.widgets.imagebutton.ImageButton.position方法的典型用法代码示例。如果您正苦于以下问题:Python ImageButton.position方法的具体用法?Python ImageButton.position怎么用?Python ImageButton.position使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类horizons.gui.widgets.imagebutton.ImageButton
的用法示例。
在下文中一共展示了ImageButton.position方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from horizons.gui.widgets.imagebutton import ImageButton [as 别名]
# 或者: from horizons.gui.widgets.imagebutton.ImageButton import position [as 别名]
def __init__(self):
self.page_widgets = {}
self.widget = load_uh_widget(self.widget_xml, center_widget=True)
# Lists holding pickbelt ImageButtons, placed to the left/right of the book
self.buttons = {'left': [], 'right': []}
for i, (name, text) in enumerate(self.sections):
self.page_widgets[i] = self.widget.findChild(name=name)
# Create the required pickbelts
for i, (name, text) in enumerate(self.sections):
for side in self.buttons:
pickbelt = ImageButton(text=text)
pickbelt.name = name + '_' + side
pickbelt.path = 'images/background/pickbelt_%s' % side
pickbelt.font = "pickbelt"
pickbelt.capture(Callback(self.update_view, i), event_name="mouseClicked")
start_x, start_y = self.pickbelt_start_pos
pickbelt.position = (start_x + 5*i, start_y + 70*i)
container = self.widget.findChild(name="%s_pickbelts" % side)
container.addChild(pickbelt)
self.buttons[side].append(pickbelt)
self.widget.show() # Hack to initially setup the pickbelts properly
self.update_view()
self.widget.hide() # Hack to initially setup the pickbelts properly