本文整理汇总了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()