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


Python widgets.StopButton类代码示例

本文整理汇总了Python中sugar3.activity.widgets.StopButton的典型用法代码示例。如果您正苦于以下问题:Python StopButton类的具体用法?Python StopButton怎么用?Python StopButton使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: make_toolbar

    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()
开发者ID:crusher95,项目名称:webconfusion,代码行数:28,代码来源:WebConfusion.py

示例2: _setup_toolbars

    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)
开发者ID:sugarlabs,项目名称:dimensions,代码行数:60,代码来源:Dimensions.py

示例3: __init__

    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()
开发者ID:YashAgarwal,项目名称:edit-fonts-activity,代码行数:30,代码来源:activity.py

示例4: __init__

    def __init__(self, handle):
        "The entry point to the Activity"
        global page
        activity.Activity.__init__(self, handle)
        
        toolbox = widgets.ActivityToolbar(self)
        toolbox.share.props.visible = False

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

        self.set_toolbar_box(toolbox)

        toolbox.show()
        self.scrolled_window = Gtk.ScrolledWindow()
        self.scrolled_window.set_policy(Gtk.PolicyType.NEVER, Gtk.PolicyType.AUTOMATIC)

        self.textview = Gtk.TextView()
        self.textview.set_editable(False)
        self.textview.set_cursor_visible(False)
        self.textview.set_left_margin(50)
        self.textview.connect("key_press_event", self.keypress_cb)

        self.scrolled_window.add(self.textview)
        self.set_canvas(self.scrolled_window)
        self.textview.show()
        self.scrolled_window.show()
        page = 0
        self.textview.grab_focus()
        self.font_desc = Pango.FontDescription("sans %d" % style.zoom(10))
        self.textview.modify_font(self.font_desc)
开发者ID:sugarlabs,项目名称:myosa-examples,代码行数:32,代码来源:ReadEtextsActivity.py

示例5: makeToolbar

 def makeToolbar(self, activity):
     self.activity = activity
     
     toolbar = ToolbarBox()
     
     activity_button = ActivityToolbarButton(activity)
     toolbar.toolbar.insert(activity_button, -1)
     activity_button.show()
     
     editmode = ToolButton('edit-description')
     editmode.set_tooltip(_("Enter Edit Mode"))
     editmode.set_accelerator(_('<ctrl>e'))
     editmode.connect('clicked', self.gotoCoding)
     toolbar.toolbar.insert(editmode, -1)
     editmode.show()
     
     separator = Gtk.SeparatorToolItem()
     separator.props.draw = False
     separator.set_expand(True)
     toolbar.toolbar.insert(separator, -1)
     separator.show()
     
     stop_button = StopButton(activity)
     toolbar.toolbar.insert(stop_button, -1)
     stop_button.show()
     
     return toolbar
开发者ID:ColdSauce,项目名称:golems,代码行数:27,代码来源:intscene.py

示例6: _setup_toolbars

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

示例7: build_toolbar

    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()
开发者ID:rafaelcor,项目名称:comunicate,代码行数:31,代码来源:activity.py

示例8: build_toolbar

    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()
开发者ID:FOSSRIT,项目名称:SkyTime,代码行数:31,代码来源:SkyTimeActivity.py

示例9: build_toolbar

    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()
开发者ID:sugarlabs,项目名称:myosa-examples,代码行数:26,代码来源:DemoiselleActivity.py

示例10: __init__

    def __init__(self, activity,**kwargs):
        super(BasicToolbar, self).__init__(**kwargs)
        
        
        activity_button = ActivityButton(activity)
        self.toolbar.insert(activity_button, 0)
        activity_button.show()

        title_entry = TitleEntry(activity)
        self.toolbar.insert(title_entry, -1)
        title_entry.show()

        description_item = DescriptionItem(activity)
        self.toolbar.insert(description_item, -1)
        description_item.show()

        share_button = ShareButton(activity)
        self.toolbar.insert(share_button, -1)
        share_button.show()

        separator = Gtk.SeparatorToolItem()
        separator.props.draw = False
        separator.set_expand(True)
        self.toolbar.insert(separator, -1)
        separator.show()

        stop_button = StopButton(activity)
        self.toolbar.insert(stop_button, -1)
        stop_button.show()
开发者ID:sugarlabs,项目名称:edit-fonts-activity,代码行数:29,代码来源:toolbar.py

示例11: __init__

    def __init__(self,handle):

        activity.Activity.__init__(self,handle,False)

        self.set_title("Ceibal_Radio")

        barraprincipal = ToolbarBox(self)

        activity_button = ActivityButton(self)
        barraprincipal.toolbar.insert(activity_button, 0)
        activity_button.show()

        title_entry = TitleEntry(self)
        barraprincipal.toolbar.insert(title_entry, -1)
        title_entry.show()
        
        separator = Gtk.SeparatorToolItem()
        separator.props.draw = False
        separator.set_expand(True)
        barraprincipal.toolbar.insert(separator, -1)
        separator.show()

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

        self.set_toolbar_box(barraprincipal)
        if not failure:
            vistareproductor = VistaReproductor()
            self.set_canvas(vistareproductor)
        else:
            error = Gtk.Label("Sorry, this activity doesn't work on this computer.")
            self.set_canvas(error)

        self.show_all()
开发者ID:Daksh,项目名称:CeibalRadio,代码行数:35,代码来源:CeibalRadioActivity.py

示例12: __init__

    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)
开发者ID:leonardcj,项目名称:Time-Line,代码行数:29,代码来源:timeline.py

示例13: __make_toolbar

    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()
开发者ID:sugarlabs,项目名称:pilas-activity,代码行数:28,代码来源:motor_activity.py

示例14: build_toolbar

    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:redxdev,项目名称:Matching,代码行数:30,代码来源:MatchingActivity.py

示例15: build_toolbar

    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()
开发者ID:sugarlabs,项目名称:Stick-Hero,代码行数:32,代码来源:activity.py


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