本文整理汇总了Python中sugar3.graphics.toolbarbox.ToolbarBox.show方法的典型用法代码示例。如果您正苦于以下问题:Python ToolbarBox.show方法的具体用法?Python ToolbarBox.show怎么用?Python ToolbarBox.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.toolbarbox.ToolbarBox
的用法示例。
在下文中一共展示了ToolbarBox.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _setup_toolbars
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def _setup_toolbars(self):
''' Setup the toolbars.. '''
tools_toolbar = Gtk.Toolbar()
numbers_toolbar = Gtk.Toolbar()
toolbox = ToolbarBox()
self.activity_toolbar_button = ActivityToolbarButton(self)
toolbox.toolbar.insert(self.activity_toolbar_button, 0)
self.activity_toolbar_button.show()
self.numbers_toolbar_button = ToolbarButton(
page=numbers_toolbar,
icon_name='number-tools')
if MODE == 'number':
numbers_toolbar.show()
toolbox.toolbar.insert(self.numbers_toolbar_button, -1)
self.numbers_toolbar_button.show()
self.tools_toolbar_button = ToolbarButton(
page=tools_toolbar,
icon_name='view-source')
self.button_pattern = button_factory(
'new-pattern-game', toolbox.toolbar, self._select_game_cb,
cb_arg='pattern', tooltip=_('New game'))
self._set_extras(toolbox.toolbar)
self._sep.append(separator_factory(toolbox.toolbar, True, False))
stop_button = StopButton(self)
stop_button.props.accelerator = '<Ctrl>q'
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
button_factory('score-copy', self.activity_toolbar_button,
self._write_scores_to_clipboard,
tooltip=_('Export scores to clipboard'))
self.set_toolbar_box(toolbox)
toolbox.show()
if MODE == 'word':
self.words_tool_button = button_factory(
'word-tools', tools_toolbar, self._edit_words_cb,
tooltip=_('Edit word lists.'))
self.import_button = button_factory(
'image-tools', tools_toolbar, self.image_import_cb,
tooltip=_('Import custom cards'))
self.button_custom = button_factory(
'new-custom-game', tools_toolbar, self._select_game_cb,
cb_arg='custom', tooltip=_('New custom game'))
self.button_custom.set_sensitive(False)
if MODE == 'number':
self._setup_number_buttons(numbers_toolbar)
示例2: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
toolbar_box = ToolbarBox()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
activity_button = ActivityToolbarButton(self)
toolbar_box.toolbar.insert(activity_button, -1)
activity_button.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(False)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
button = ToolButton('speaker-muted-100')
button.set_tooltip(_('Sound'))
button.connect('clicked', self.sound_control)
toolbar_box.toolbar.insert(button, -1)
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.show_all()
示例3: _setup_toolbars
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def _setup_toolbars(self):
custom_toolbar = Gtk.Toolbar()
toolbox = ToolbarBox()
self._toolbar = toolbox.toolbar
self._activity_button = ActivityToolbarButton(self)
self._activity_button.connect('clicked', self._update_graphics)
self._toolbar.insert(self._activity_button, 0)
self._activity_button.show()
self._custom_toolbar_button = ToolbarButton(
label=_('Custom'),
page=custom_toolbar,
icon_name='view-source')
self._custom_toolbar_button.connect('clicked', self._update_graphics)
custom_toolbar.show()
self._toolbar.insert(self._custom_toolbar_button, -1)
self._custom_toolbar_button.show()
self._load_standard_buttons(self._toolbar)
self._separator = Gtk.SeparatorToolItem()
self._separator.props.draw = False
self._separator.set_expand(True)
self._toolbar.insert(self._separator, -1)
self._separator.show()
stop_button = StopButton(self)
stop_button.props.accelerator = _('<Ctrl>Q')
self._toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
self._load_custom_buttons(custom_toolbar)
示例4: __init__
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def __init__(self, handle):
"""Set up the HelloWorld activity."""
activity.Activity.__init__(self, handle)
self.max_participants = 1
toolbar_box = ToolbarBox()
activity_button = ActivityToolbarButton(self)
toolbar_box.toolbar.insert(activity_button, 0)
activity_button.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
self.init_fonts()
self.font_list = FontsList(self._all_fonts, self._font_white_list)
self.set_canvas(self.font_list)
self.show_all()
示例5: __make_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def __make_toolbar(self):
# toolbar with the new toolbar redesign
toolbar_box = ToolbarBox()
activity_button = ActivityButton(self)
toolbar_box.toolbar.insert(activity_button, 0)
activity_button.show()
title_entry = TitleEntry(self)
toolbar_box.toolbar.insert(title_entry, -1)
title_entry.show()
share_button = ShareButton(self)
toolbar_box.toolbar.insert(share_button, -1)
share_button.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
示例6: __init__
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def __init__(self, handle):
activity.Activity.__init__(self, handle)
self.max_participants = 1
toolbar_box = ToolbarBox()
activity_button = ActivityButton(self)
toolbar_box.toolbar.insert(activity_button, 0)
activity_button.show()
title_entry = TitleEntry(self)
toolbar_box.toolbar.insert(title_entry, -1)
title_entry.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
self.signal = self.connect("draw", self.execute)
示例7: _setup_toolbars
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def _setup_toolbars(self):
""" Setup the toolbars. """
self.max_participants = 4
toolbox = ToolbarBox()
# Activity toolbar
activity_button = ActivityToolbarButton(self)
toolbox.toolbar.insert(activity_button, 0)
activity_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
self.toolbar = toolbox.toolbar
self._new_game_button_h = button_factory(
'new-game', self.toolbar, self._new_game_cb,
tooltip=_('Start a game.'))
self.status = label_factory(self.toolbar, '')
separator_factory(toolbox.toolbar, True, False)
self.solver = button_factory(
'help-toolbar', self.toolbar,
self._solve_cb,
tooltip=_('Solve the puzzle'))
stop_button = StopButton(self)
stop_button.props.accelerator = '<Ctrl>q'
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
示例8: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
toolbar_box = ToolbarBox()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
activity_button = ActivityToolbarButton(self)
toolbar_box.toolbar.insert(activity_button, -1)
activity_button.show()
# Pause/Play button:
stop_play = ToolButton('media-playback-stop')
stop_play.set_tooltip(_("Stop"))
stop_play.set_accelerator(_('<ctrl>space'))
stop_play.connect('clicked', self._stop_play_cb)
stop_play.show()
toolbar_box.toolbar.insert(stop_play, -1)
# Blank space (separator) and Stop button at the end:
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
示例9: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
toolbar_box = ToolbarBox()
activity_button = ActivityButton(self)
toolbar_box.toolbar.insert(activity_button, 0)
activity_button.show()
title_entry = TitleEntry(self)
toolbar_box.toolbar.insert(title_entry, -1)
title_entry.show()
description_item = DescriptionItem(self)
toolbar_box.toolbar.insert(description_item, -1)
description_item.show()
share_button = ShareButton(self)
toolbar_box.toolbar.insert(share_button, -1)
share_button.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
示例10: __init__
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def __init__(self, handle):
activity.Activity.__init__(self, handle)
self.set_title("SocialCalc")
self._logger = logging.getLogger("OnePageWiki-Activity")
# The XOCom object helps us communicate with the browser
# This uses web/index.html as the default page to load
self.xocom = XOCom(
self.control_sending_text
) # REMEMBER THAT I HAVE STILL TO SEND THE ARGUMENT IN THE XOCOM CLASS
toolbox = ToolbarBox()
activity_button = ActivityButton(self)
toolbox.toolbar.insert(activity_button, 0)
activity_button.show()
title_entry = TitleEntry(self)
toolbox.toolbar.insert(title_entry, -1)
title_entry.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbox.toolbar.insert(separator, -1)
separator.show()
stop_button = ShareButton(self)
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
stop_button = StopButton(self)
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
##self.xocom.send_to_browser_localize(['initlocalize'])
self.set_canvas(self.xocom.create_webview())
self.hellotube = None # Shared session #REQUIRED
self.initiating = False
self.pservice = presenceservice.get_instance()
owner = self.pservice.get_owner()
self.owner = owner
self.connect("shared", self._shared_cb)
self.connect("joined", self._joined_cb)
self.filename = "" # ADDED SPECIFICALLY TO CALL WRITE AND READ METHODS
self.content = ""
# calling to initialize strings in localization
# should wait for init complete from browser
GObject.timeout_add(4000, self.xocom.send_to_browser_localize, ["initlocalize"])
示例11: _setup_toolbars
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def _setup_toolbars(self, have_toolbox):
""" Setup the toolbars. """
self.max_participants = 1 # No sharing
if have_toolbox:
toolbox = ToolbarBox()
# Activity toolbar
activity_button = ActivityToolbarButton(self)
toolbox.toolbar.insert(activity_button, 0)
activity_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
self.toolbar = toolbox.toolbar
else:
# Use pre-0.86 toolbar design
games_toolbar = Gtk.Toolbar()
toolbox = activity.ActivityToolbox(self)
self.set_toolbox(toolbox)
toolbox.add_toolbar(_('Game'), games_toolbar)
toolbox.show()
toolbox.set_current_toolbar(1)
self.toolbar = games_toolbar
self._save_colors_button = button_factory(
'save-colors', self.toolbar, self._save_colors_cb,
tooltip=_('Save colors'))
if _have_toolbox:
separator_factory(toolbox.toolbar, True, False)
stop_button = StopButton(self)
stop_button.props.accelerator = '<Ctrl>q'
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
示例12: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
# Create the toolbar box
toolbar_box = ToolbarBox()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
# Create the activity button
activity_button = ActivityToolbarButton(self)
toolbar_box.toolbar.insert(activity_button, -1)
activity_button.show()
# Create the pause/play button
stop_play = ToolButton('media-playback-stop')
stop_play.set_tooltip(_("Stop"))
stop_play.set_accelerator(_('<ctrl>space'))
stop_play.connect('clicked', self.stop_play_cb)
stop_play.show()
toolbar_box.toolbar.insert(stop_play, -1)
# Create a blank separator and a Stop button
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
示例13: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
toolbar_box = ToolbarBox()
view_toolbar = ViewToolbar()
view_toolbar.connect('go-fullscreen',
self.view_toolbar_go_fullscreen_cb)
view_toolbar.show()
view_toolbar_button = ToolbarButton(
page=view_toolbar,
icon_name='toolbar-view')
toolbar_box.toolbar.insert(view_toolbar_button, -1)
view_toolbar_button.show()
separator = Gtk.SeparatorToolItem()
separator.props.draw = False
separator.set_expand(True)
toolbar_box.toolbar.insert(separator, -1)
separator.show()
stop_button = StopButton(self)
stop_button.props.accelerator = '<Ctrl><Shift>Q'
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
示例14: make_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def make_toolbar(self):
toolbar_box = ToolbarBox()
activity_button = ActivityToolbarButton(self)
toolbar_box.toolbar.insert(activity_button, 0)
activity_button.show()
self._go_home = ToolButton('go-home')
self._go_home.set_tooltip(_('Home page'))
self._go_home.connect('clicked', self._go_home_cb)
toolbar_box.toolbar.insert(self._go_home, -1)
self._go_home.show()
self._browse = ToolButton('browse')
self._browse.set_tooltip(_('Open in Browse'))
self._browse.connect('clicked', self._do_browse_clicked_cb)
toolbar_box.toolbar.insert(self._browse, -1)
self._browse.show()
separator=Gtk.SeparatorToolItem(draw=False)
separator.set_expand(True)
toolbar_box.toolbar.insert(separator,-1)
separator.show()
stop_button = StopButton(self)
toolbar_box.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbar_box)
toolbar_box.show()
示例15: build_toolbar
# 需要导入模块: from sugar3.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar3.graphics.toolbarbox.ToolbarBox import show [as 别名]
def build_toolbar(self):
toolbox = ToolbarBox()
activity_button = ActivityToolbarButton(self)
toolbox.toolbar.insert(activity_button, -1)
activity_button.show()
self.build_birth_toolbar(toolbox)
self.build_today_toolbar(toolbox)
separador13 = Gtk.SeparatorToolItem()
separador13.props.draw = False
separador13.set_expand(True)
toolbox.toolbar.insert(separador13, -1)
stop_button = StopButton(self)
stop_button.props.accelerator = _('<Ctrl>Q')
toolbox.toolbar.insert(stop_button, -1)
stop_button.show()
self.set_toolbar_box(toolbox)
toolbox.show()
self.show_all()