当前位置: 首页>>代码示例>>Python>>正文


Python ToolbarBox.show方法代码示例

本文整理汇总了Python中sugar.graphics.toolbarbox.ToolbarBox.show方法的典型用法代码示例。如果您正苦于以下问题:Python ToolbarBox.show方法的具体用法?Python ToolbarBox.show怎么用?Python ToolbarBox.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sugar.graphics.toolbarbox.ToolbarBox的用法示例。


在下文中一共展示了ToolbarBox.show方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _setup_toolbars

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def _setup_toolbars(self, have_toolbox):
        """ Setup the toolbars. """

        self.max_participants = MAX_HANDS

        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._new_game_button = button_factory(
            'new-game', self.toolbar, self._new_game_cb,
            tooltip=_('Start a new game.'))

        self.robot_button = button_factory(
            'robot-off', self.toolbar, self._robot_cb,
            tooltip= _('Play with the robot.'))

        self.player = image_factory(
            svg_str_to_pixbuf(generate_xo(scale=0.8,
                                          colors=['#303030', '#303030'])),
            self.toolbar, tooltip=self.nick)

        self.dialog_button = button_factory(
            'go-next', self.toolbar, self._dialog_cb,
            tooltip=_('Turn complete'))

        self.status = label_factory(self.toolbar, '')

        self.hint_button = button_factory(
            'help-toolbar', self.toolbar, self._hint_cb,
            tooltip=_('Help'))

        self.score = label_factory(self.toolbar, _('Score: ') + '0')

        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()
开发者ID:erilyth,项目名称:paths,代码行数:62,代码来源:PathsActivity.py

示例2: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.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()
开发者ID:markamber,项目名称:spacemath,代码行数:32,代码来源:TestActivity.py

示例3: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.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_calibrate_toolbar(toolbox)
        self.build_options_toolbar(toolbox)
        self.build_resolution_toolbar(toolbox)
        self.build_colors_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_toolbox(toolbox)
        toolbox.show()

        self.show_all()
开发者ID:rbuj,项目名称:followme,代码行数:29,代码来源:activity.py

示例4: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.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()

        self.blocklist = [] 
        self.radioList = {}
        for c in tools.allTools:                             
            button = ToolButton(c.icon)
            button.set_tooltip(_(c.toolTip))
            button.connect('clicked',self.radioClicked)
            toolbar_box.toolbar.insert(button, -1)    
            button.show()
            self.radioList[button] = c.name
       
        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()
开发者ID:davelab6,项目名称:Bridge,代码行数:32,代码来源:activity.py

示例5: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.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()

        separator1 = gtk.SeparatorToolItem()
        separator1.props.draw = True
        separator1.set_expand(False)
        toolbar_box.toolbar.insert(separator1, -1)
        separator1.show()

        item1 = gtk.ToolItem()
        label1 = gtk.Label()
        label1.set_text(_('Levels') + ' ')
        item1.add(label1)
        toolbar_box.toolbar.insert(item1, -1)

        item2 = gtk.ToolItem()

        levels = (_('Cross'),
            _('Cross 2'),
            #TRANS:'chimney' - the place where you make fire
            _('Hearth'),
            _('Arrow'),
            _('Pyramid'),
            _('Diamond'),
            _('Solitaire'))
        combo = Combo(levels)
        item2.add(combo)
        combo.connect('changed', self.change_combo)
        toolbar_box.toolbar.insert(item2, -1)

        separator2 = gtk.SeparatorToolItem()
        separator2.props.draw = True
        separator2.set_expand(False)
        toolbar_box.toolbar.insert(separator2, -1)
        separator2.show()

        sound_button = ToolButton('speaker-muted-100')
        sound_button.set_tooltip(_('Sound'))
        sound_button.connect('clicked', self.sound_control)
        toolbar_box.toolbar.insert(sound_button, -1)

        separator3 = gtk.SeparatorToolItem()
        separator3.props.draw = False
        separator3.set_expand(True)
        toolbar_box.toolbar.insert(separator3, -1)
        separator3.show()

        stop_button = StopButton(self)
        toolbar_box.toolbar.insert(stop_button, -1)
        stop_button.show()


        self.show_all()
开发者ID:rbuj,项目名称:jump,代码行数:61,代码来源:activity.py

示例6: _setup_toolbars

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def _setup_toolbars(self, have_toolbox):
        """ Setup the toolbars.. """

        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()
            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)
            toolbar = games_toolbar

        # Add the buttons and labels to the toolbars
        self.level_button = button_factory(
            LEVEL_ICONS[self._play_level], toolbar, self.change_play_level_cb,
            tooltip=_('Set difficulty level.'))
        mode = self._play_mode
        mode += 1
        if mode == len(GAME_ICONS):
            mode = 0
        self.game_buttons = []
        for i in range(len(GAME_ICONS)):
            if i==0:
                self.game_buttons.append(radio_factory(
                        GAME_ICONS[0], toolbar, self.change_play_mode_cb,
                        cb_arg=0, tooltip=_('Select game.'), group=None))
            else:
                self.game_buttons.append(radio_factory(
                        GAME_ICONS[i], toolbar, self.change_play_mode_cb,
                        cb_arg=i, tooltip=_('Select game.'),
                        group=self.game_buttons[0]))
        self.game_buttons[mode].set_active(True)
        separator_factory(toolbar, False, True)
        self.status_label = label_factory(toolbar, _("drag to swap"))

        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()
开发者ID:leonardcj,项目名称:pukllanapac,代码行数:58,代码来源:PukllanapacActivity.py

示例7: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):

        activity.Activity.__init__(self, handle)

        self.max_participants = 10

        # 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()

        stop_button = StopButton(self)
        toolbar_box.toolbar.insert(stop_button, -1)
        stop_button.show()

        self.back_button = BackButton()
        self.back_button.connect("clicked", self.show_options1)
        toolbar_box.toolbar.insert(self.back_button, 0)
        self.back_button.show()

        self.set_toolbar_box(toolbar_box)
        toolbar_box.show()

        self.show_options()

        self._logger = logging.getLogger("hellomesh-activity")

        self.hellotube = None  # Shared session
        self.initiating = False

        # get the Presence Service
        self.pservice = presenceservice.get_instance()
        # Buddy object for you
        owner = self.pservice.get_owner()
        self.owner = owner

        self.connect("shared", self._shared_cb)
        self.connect("joined", self._joined_cb)
开发者ID:Daksh,项目名称:devtutor,代码行数:50,代码来源:activity.py

示例8: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):
        """Set up the Pilas activity."""
        activity.Activity.__init__(self, handle)

        # we do not have collaboration features,
        # make the share option insensitive
        self.max_participants = 1

        # 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()

        socket = gtk.Socket()
        socket.connect("plug-added", self._on_plugged_event)
        socket.set_flags(gtk.CAN_FOCUS)
        self.set_canvas(socket)
        self.set_focus(socket)
        socket.show()

        screen_width = gtk.gdk.screen_width()
        screen_height = gtk.gdk.screen_height()

        Popen(["python", "pilas_plug.py", str(socket.get_id()),
               str(screen_width), str(screen_height)], env=new_env)
开发者ID:DanKaLeo,项目名称:pilas,代码行数:50,代码来源:activity.py

示例9: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def build_toolbar(self):
        toolbar_box = ToolbarBox()
        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(True)

        toolbar_box.toolbar.insert(separator, -1)
        stop_button = StopButton(self)
        toolbar_box.toolbar.insert(stop_button, -1)
        stop_button.show()

        self.set_toolbar_box(toolbar_box)
        toolbar_box.show_all()
开发者ID:bonillab,项目名称:NicMat,代码行数:21,代码来源:activity.py

示例10: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):
        """Set up the ActivityTemplate activity."""
        activity.Activity.__init__(self, handle)

        # we do not have collaboration features
        # make the share option insensitive
        self.max_participants = 1

        # 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()

        # Code changes made by glucosa team, the three lines
        # makes the game graphic area.
        self.game = Game()
        self.set_canvas(self.game.canvas)

        self.game.canvas.show()
开发者ID:hugoruscitti,项目名称:glucosa,代码行数:44,代码来源:activity.py

示例11: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):
        """Set up the HelloWorld activity."""
        activity.Activity.__init__(self, handle)

        # we do not have collaboration features
        # make the share option insensitive
        self.max_participants = 1

        # 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()

        # label with the text, make the string translatable
        #label = gtk.Label(_("Hello World!"))
        main = Main()

        self.set_canvas(main)
        main.show()
开发者ID:colemancda,项目名称:peru-learns-english,代码行数:44,代码来源:activity.py

示例12: add_line2

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
 def add_line2(self):
     self.line = gtk.HBox()
     
     self.label = gtk.Label(_("sugar.activity.widgets.ActivityButton()"))
     self.line.add(self.label)        
     self.label.show()    
    
     toolbar_box1 = ToolbarBox()        
     self.line.add(toolbar_box1) 
     toolbar_box1.show()
     
     activity_button1 = ActivityButton(self)
     toolbar_box1.toolbar.insert(activity_button1, 0)
     activity_button1.show()       
     
     self.label1 = gtk.Label(_("Some Description"))
     self.line.add(self.label1)          
     self.label1.show()    
     
     self.container.add(self.line) 
     self.line.show() 
开发者ID:Daksh,项目名称:devtutor,代码行数:23,代码来源:modules.py

示例13: add_line8

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
 def add_line8(self):
     self.line = gtk.HBox()
     
     self.label = gtk.Label(_("sugar.activity.widgets.PasteButton()"))      
     self.line.add(self.label)  
     self.label.show()    
    
     toolbar_box1 = ToolbarBox()        
     self.line.add(toolbar_box1) 
     toolbar_box1.show()
     
     title_entry1 = PasteButton()
     toolbar_box1.toolbar.insert(title_entry1, 0)
     title_entry1.show()
      
     self.label1 = gtk.Label(_("Some Description"))
     self.line.add(self.label1)          
     self.label1.show()    
    
     self.container.add(self.line) 
     self.line.show() 
开发者ID:Daksh,项目名称:devtutor,代码行数:23,代码来源:modules.py

示例14: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):
        """Set up the LiveDemo activity."""
        activity.Activity.__init__(self, handle)

        # we do not have collaboration features
        # make the share option insensitive
        self.max_participants = 1

        # toolbar with the new toolbar redesign
        toolbar_box = ToolbarBox()

        activity_button = ActivityButton(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()

        # box principal
        main_box = gtk.VBox()
        self.init_gui(main_box)
        self.set_canvas(main_box)
        self.set_toolbar_box(toolbar_box)
        self.set_canvas(main_box)
        self.set_toolbar_box(toolbar_box)
        toolbar_box.show()
        main_box.show_all()
        
        self.__path = os.path.dirname(os.path.abspath(__file__))
        self.__recognizer = helper.RecognitionHelper(self.__path)
        self.__recognizer.listen(self.final_result)
        self.__recognizer.start_listening()
开发者ID:rparrapy,项目名称:sugarlistens-livedemo,代码行数:41,代码来源:activity.py

示例15: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show [as 别名]
    def __init__(self, handle):
        """Set up the HelloWorld activity."""
        activity.Activity.__init__(self, handle)

        # Change the following number to change max participants
        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()

        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()

        # Change the following text to change the message (Default: 'Hello World!'
        label = gtk.Label(_("Hello World!"))
        self.set_canvas(label)
        label.show()
开发者ID:godiard,项目名称:develop-activity,代码行数:40,代码来源:activity.py


注:本文中的sugar.graphics.toolbarbox.ToolbarBox.show方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。