本文整理匯總了Python中horizons.gui.widgets.imagebutton.ImageButton.font方法的典型用法代碼示例。如果您正苦於以下問題:Python ImageButton.font方法的具體用法?Python ImageButton.font怎麽用?Python ImageButton.font使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類horizons.gui.widgets.imagebutton.ImageButton
的用法示例。
在下文中一共展示了ImageButton.font方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from horizons.gui.widgets.imagebutton import ImageButton [as 別名]
# 或者: from horizons.gui.widgets.imagebutton.ImageButton import font [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