本文整理匯總了Python中horizons.gui.widgets.imagebutton.ImageButton.helptext方法的典型用法代碼示例。如果您正苦於以下問題:Python ImageButton.helptext方法的具體用法?Python ImageButton.helptext怎麽用?Python ImageButton.helptext使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類horizons.gui.widgets.imagebutton.ImageButton
的用法示例。
在下文中一共展示了ImageButton.helptext方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: _init_tabs
# 需要導入模塊: from horizons.gui.widgets.imagebutton import ImageButton [as 別名]
# 或者: from horizons.gui.widgets.imagebutton.ImageButton import helptext [as 別名]
def _init_tabs(self):
"""Add enough tabbuttons for all widgets."""
def on_tab_removal(tabwidget):
# called when a tab is being removed (via weakref since tabs shouldn't have references to the parent tabwidget)
# If one tab is removed, the whole tabwidget will die..
# This is easy usually the desired behavior.
if tabwidget():
tabwidget().on_remove()
# Load buttons
for index, tab in enumerate(self._tabs):
# don't add a reference to the
tab.add_remove_listener(Callback(on_tab_removal, weakref.ref(self)))
container = Container(name="container_%s" % index)
background = Icon(name="bg_%s" % index)
button = ImageButton(name=str(index), size=(50, 50))
if self.current_tab is tab:
background.image = tab.button_background_image_active
button.path = tab.path_active
else:
background.image = tab.button_background_image
button.path = tab.path
button.capture(Callback(self._show_tab, index))
if hasattr(tab, 'helptext') and tab.helptext is not None:
button.helptext = tab.helptext
container.size = background.size
container.addChild(background)
container.addChild(button)
self.content.addChild(container)
self.widget.size = (50, 55*len(self._tabs))
self.widget.adaptLayout()
self._apply_layout_hack()