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


Python ToolbarBox.show_all方法代码示例

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


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

示例1: build_toolbar

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

示例2: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show_all [as 别名]
    def __init__(self, handle):
        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 = ActivityToolbarButton(self)
        toolbar_box.toolbar.insert(activity_button, 0)

        toolbar_box.toolbar.insert(gtk.SeparatorToolItem(), -1)

        self.image_viewer = ImageCollectionViewer(False)

        prev_bt = ToolButton("go-previous-paired")
        prev_bt.connect("clicked", self.image_viewer.prev_anim_clicked_cb,
                None)
        toolbar_box.toolbar.insert(prev_bt, -1)

        next_bt = ToolButton("go-next-paired")
        next_bt.connect("clicked", self.image_viewer.next_anim_clicked_cb,
                None)
        toolbar_box.toolbar.insert(next_bt, -1)

        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)

        self.set_toolbar_box(toolbar_box)
        toolbar_box.show_all()

        self.modify_bg(gtk.STATE_NORMAL, style.COLOR_WHITE.get_gdk_color())
        self.set_canvas(self.image_viewer)
开发者ID:AlanJAS,项目名称:Sugarizer,代码行数:42,代码来源:activity.py

示例3: build_toolbar

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show_all [as 别名]
    def build_toolbar(self):
        """Build our Activity toolbar for the Sugar system."""

        toolbar_box = ToolbarBox()
        activity_button = ActivityToolbarButton(self)
        toolbar_box.toolbar.insert(activity_button, 0)
        activity_button.show()

        separator = gtk.SeparatorToolItem()
        toolbar_box.toolbar.insert(separator, -1)
        separator.show()

        easier_button = ToolButton('create-easier')
        easier_button.set_tooltip(_('Easier level'))
        easier_button.connect('clicked', self._easier_button_cb)
        toolbar_box.toolbar.insert(easier_button, -1)

        harder_button = ToolButton('create-harder')
        harder_button.set_tooltip(_('Harder level'))
        harder_button.connect('clicked', self._harder_button_cb)
        toolbar_box.toolbar.insert(harder_button, -1)

        separator = gtk.SeparatorToolItem()
        separator.props.draw = False
        separator.set_size_request(0, -1)
        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_all()

        self.connect("destroy", self.__stop_pygame)

        return toolbar_box
开发者ID:rparrapy,项目名称:maze,代码行数:41,代码来源:activity.py

示例4: __init__

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

        self.chatbox = ChatBox()

        super(ChatStudioSelf, self).__init__(handle)

        self.entry = None
        self.no_of_mistake = 0
        root = self.make_root()
        self.set_canvas(root)

        root.show_all()
        self.entry.grab_focus()
        self.score1 = 0
        self.accuracy = 0.0

        toolbar_box = ToolbarBox()
        self.set_toolbar_box(toolbar_box)
        toolbar_box.toolbar.insert(ActivityButton(self), -1)
        toolbar_box.toolbar.insert(TitleEntry(self), -1)
        try:
            from sugar.activity.widgets import DescriptionItem
        except ImportError:
            logger.debug("DescriptionItem button is not available, " "toolkit version < 0.96")
        else:
            description_item = DescriptionItem(self)
            toolbar_box.toolbar.insert(description_item, -1)
            description_item.show()

        StartLabel = gtk.Label(_("START: "))
        StartLabel.show()
        tool_item_StartLabel = gtk.ToolItem()
        tool_item_StartLabel.add(StartLabel)
        toolbar_box.toolbar.insert(tool_item_StartLabel, -1)
        tool_item_StartLabel.show()
        mc1 = MathCompEntry1(self)
        toolbar_box.toolbar.insert(mc1, -1)

        AddLabel = gtk.Label(_("  ADD: "))
        AddLabel.show()
        tool_item_AddLabel = gtk.ToolItem()
        tool_item_AddLabel.add(AddLabel)
        toolbar_box.toolbar.insert(tool_item_AddLabel, -1)
        tool_item_AddLabel.show()
        mc2 = MathCompEntry2(self)
        toolbar_box.toolbar.insert(mc2, -1)
        separator = gtk.SeparatorToolItem()
        toolbar_box.toolbar.insert(separator, -1)
        separator = gtk.SeparatorToolItem()
        toolbar_box.toolbar.insert(separator, -1)
        self._smiley = RadioMenuButton(icon_name="smilies")
        self._smiley.palette = Palette(_("Insert smiley"))
        self._smiley.props.sensitive = True
        # toolbar_box.toolbar.insert(self._smiley, -1)

        separator = gtk.SeparatorToolItem()
        separator.props.draw = False
        separator.set_expand(False)
        toolbar_box.toolbar.insert(separator, -1)
        scoreButton = ScoreButton(self)
        toolbar_box.toolbar.insert(scoreButton, -1)
        stopButton = StopButton(self)
        toolbar_box.toolbar.insert(stopButton, -1)
        toolbar_box.show_all()
        self.a1 = c1
        self.a2 = c2
        self.sum1 = self.a1 + self.a2
        pservice = presenceservice.get_instance()
        self.owner = pservice.get_owner()
        # Chat is room or one to one:
        self._chat_is_room = False
        self.text_channel = None

        if self.shared_activity:
            # we are joining the activity
            self.connect("joined", self._joined_cb)
            if self.get_shared():
                # we have already joined
                self._joined_cb(self)
        elif handle.uri:
            # XMPP non-Sugar incoming chat, not sharable
            share_button.props.visible = False
            self._one_to_one_connection(handle.uri)
        else:
            # we are creating the activity
            # if not self.metadata or self.metadata.get('share-scope',activity.SCOPE_PRIVATE) == activity.SCOPE_PRIVATE:
            # if we are in private session
            # self._alert(_('Off-line'), _('Share, or invite someone.'))
            self.connect("shared", self._shared_cb)
开发者ID:Gopaal,项目名称:2014-interns,代码行数:92,代码来源:activity.py

示例5: __init__

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

        self._notebook = gtk.Notebook()
        self.set_canvas(self._notebook)
        self._notebook.show()

        self._colors = profile.get_color().to_string().split(',')
        lighter = style.Color(self._colors[
            _lighter_color(self._colors)])

        self._mode = MODE_TYPE
        self._tablet_mode = _is_tablet_mode()
        self._robot_idle_id = None
        self._active_eyes = None
        self._active_number_of_eyes = None
        self._current_voice = None

        # make an audio device for playing back and rendering audio
        self.connect('notify::active', self._active_cb)
        self._cfg = {}

        # make a box to type into
        hbox = gtk.HBox()

        if self._tablet_mode:
            self._entry = gtk.Entry()
            hbox.pack_start(self._entry, expand=True)
            talk_button = ToolButton('microphone')
            talk_button.set_tooltip(_('Speak'))
            talk_button.connect('clicked', self._talk_cb)
            hbox.pack_end(talk_button, expand=False)
        else:
            self._entrycombo = gtk.combo_box_entry_new_text()
            self._entrycombo.connect('changed', self._combo_changed_cb)
            self._entry = self._entrycombo.child
            self._entry.set_size_request(-1, style.GRID_CELL_SIZE)
            hbox.pack_start(self._entrycombo, expand=True)
        self._entry.set_editable(True)
        self._entry.connect('activate', self._entry_activate_cb)
        self._entry.connect('key-press-event', self._entry_key_press_cb)
        self._entry.modify_font(pango.FontDescription(str='sans bold 24'))
        hbox.show()

        self.face = face.View(fill_color=lighter)
        self.face.set_size_request(
            -1, gtk.gdk.screen_height() - 2 * style.GRID_CELL_SIZE)
        self.face.show()

        # layout the screen
        box = gtk.VBox(homogeneous=False)
        if self._tablet_mode:
            box.pack_start(hbox, expand=False)
            box.pack_start(self.face)
        else:
            box.pack_start(self.face, expand=True)
            box.pack_start(hbox)

        self.add_events(gtk.gdk.POINTER_MOTION_HINT_MASK
                        | gtk.gdk.POINTER_MOTION_MASK)
        self.connect('motion_notify_event', self._mouse_moved_cb)

        box.add_events(gtk.gdk.BUTTON_PRESS_MASK)
        box.connect('button_press_event', self._mouse_clicked_cb)

        # desktop
        self._notebook.show()
        self._notebook.props.show_border = False
        self._notebook.props.show_tabs = False

        box.show_all()
        self._notebook.append_page(box)

        self._chat = chat.View()
        self._chat.show_all()
        self._notebook.append_page(self._chat)

        # make the text box active right away
        if not self._tablet_mode:
            self._entry.grab_focus()

        self._entry.connect('move-cursor', self._cursor_moved_cb)
        self._entry.connect('changed', self._cursor_moved_cb)

        toolbox = ToolbarBox()
        self._activity_button = ActivityToolbarButton(self)
        self._activity_button.connect('clicked', self._configure_cb)

        toolbox.toolbar.insert(self._activity_button, -1)

        mode_type = RadioToolButton(
            named_icon='mode-type',
            tooltip=_('Type something to hear it'))
        mode_type.connect('toggled', self.__toggled_mode_type_cb)
        toolbox.toolbar.insert(mode_type, -1)

        mode_robot = RadioToolButton(
            named_icon='mode-robot',
            group=mode_type,
            tooltip=_('Ask robot any question'))
#.........这里部分代码省略.........
开发者ID:Akirato,项目名称:speak,代码行数:103,代码来源:activity.py

示例6: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show_all [as 别名]

#.........这里部分代码省略.........
            append('toolbar-algebra',
                   _('Algebra'),
                   AlgebraToolbar(self._parent),
                   -1)
            
            append('toolbar-trigonometry',
                   _('Trigonometry'),
                   TrigonometryToolbar(self._parent),
                   -1)

            append('toolbar-boolean',
                   _('Boolean'),
                   BooleanToolbar(self._parent),
                   -1)

            self._misc_toolbar = MiscToolbar(
                self._parent,
                target_toolbar=self._toolbar_box.toolbar)

            append('toolbar-constants',
                   _('Miscellaneous'),
                   self._misc_toolbar,
                   5)
            
            self._stop_separator = gtk.SeparatorToolItem()
            self._stop_separator.props.draw = False
            self._stop_separator.set_expand(True)
            self._stop_separator.show()
            self._toolbar_box.toolbar.insert(self._stop_separator, -1)

            self._stop = StopButton(self._parent)
            self._toolbar_box.toolbar.insert(self._stop, -1)

            self._toolbar_box.show_all()
            self._parent.set_toolbar_box(self._toolbar_box)

        except NameError:
            # Use old toolbar design
            toolbox = activity.ActivityToolbox(self._parent)
            self._parent.set_toolbox(toolbox)
            toolbox.add_toolbar(_('Edit'), EditToolbar(self._parent))
            toolbox.add_toolbar(_('Algebra'), AlgebraToolbar(self._parent))
            toolbox.add_toolbar(_('Trigonometry'), TrigonometryToolbar(self._parent))
            toolbox.add_toolbar(_('Boolean'), BooleanToolbar(self._parent))
            toolbox.add_toolbar(_('Miscellaneous'), MiscToolbar(self._parent))
            toolbox.show_all()

# Some layout constants
        self.input_font = pango.FontDescription(str='sans bold 12')
        self.button_font = pango.FontDescription(str='sans bold 16')
        self.col_white = self.create_color(1.00, 1.00, 1.00)
        self.col_gray1 = self.create_color(0.76, 0.76, 0.76)
        self.col_gray2 = self.create_color(0.50, 0.50, 0.50)
        self.col_gray3 = self.create_color(0.25, 0.25, 0.25)
        self.col_black = self.create_color(0.00, 0.00, 0.00)
        self.col_red = self.create_color(1.00, 0.00, 0.00)

# Big - Table, 16 rows, 10 columns, homogeneously divided
        self.grid = gtk.Table(26, 11, True)
        self.grid.set_border_width(0)
        self.grid.set_row_spacings(0)
        self.grid.set_col_spacings(4)

# Left part: container and input
        vc1 = gtk.VBox(False, 0)
        hc1 = gtk.HBox(False, 10)
开发者ID:CSCI-362-03-2015,项目名称:SilverBullet,代码行数:70,代码来源:layout.py

示例7: __init__

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

        super(Chat, self).__init__(handle)

        self.entry = None

        root = self.make_root()
        self.set_canvas(root)
        root.show_all()
        self.entry.grab_focus()

        toolbar_box = ToolbarBox()
        self.set_toolbar_box(toolbar_box)
        toolbar_box.toolbar.insert(ActivityButton(self), -1)
        toolbar_box.toolbar.insert(TitleEntry(self), -1)

        try:
            from sugar.activity.widgets import DescriptionItem
        except ImportError:
            logger.debug('DescriptionItem button is not available, ' \
                   'toolkit version < 0.96')
        else:
            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)

        separator = gtk.SeparatorToolItem()
        toolbar_box.toolbar.insert(separator, -1)

        self._smiley = RadioMenuButton(icon_name='smilies')
        self._smiley.palette = Palette(_('Insert smiley'))
        self._smiley.props.sensitive = False
        toolbar_box.toolbar.insert(self._smiley, -1)

        table = self._create_pallete_smiley_table()
        table.show_all()
        self._smiley.palette.set_content(table)

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

        toolbar_box.toolbar.insert(StopButton(self), -1)
        toolbar_box.show_all()

        pservice = presenceservice.get_instance()
        self.owner = pservice.get_owner()
        # Chat is room or one to one:
        self._chat_is_room = False
        self.text_channel = None

        if self.shared_activity:
            # we are joining the activity
            self.connect('joined', self._joined_cb)
            if self.get_shared():
                # we have already joined
                self._joined_cb(self)
        elif handle.uri:
            # XMPP non-Sugar incoming chat, not sharable
            share_button.props.visible = False
            self._one_to_one_connection(handle.uri)
        else:
            # we are creating the activity
            if not self.metadata or self.metadata.get('share-scope',
                    activity.SCOPE_PRIVATE) == activity.SCOPE_PRIVATE:
                # if we are in private session
                self._alert(_('Off-line'), _('Share, or invite someone.'))
            self.connect('shared', self._shared_cb)
开发者ID:i5o,项目名称:chat,代码行数:76,代码来源:activity.py

示例8: __init__

# 需要导入模块: from sugar.graphics.toolbarbox import ToolbarBox [as 别名]
# 或者: from sugar.graphics.toolbarbox.ToolbarBox import show_all [as 别名]
    def __init__ (self, handle):
        if os.path.exists('/tmp/1'):
            os.remove('/tmp/1')
            activity.Activity.__init__ (self, handle)

            # abiword uses the current directory for all its file dialogs
            os.chdir(os.path.expanduser('~'))

            # create our main abiword canvas
            self.abiword_canvas = Canvas()

            self.set_canvas(self.abiword_canvas)
            self.abiword_canvas.connect_after('map-event', self.__map_event_cb)
            self.abiword_canvas.show()


        if os.path.exists('/tmp/2'):
            os.remove('/tmp/2')
            toolbar_box = ToolbarBox()

            activity_button = ActivityToolbarButton(self)

            separator = gtk.SeparatorToolItem()
            separator.show()
            activity_button.props.page.insert(separator, 2)
            export_button = ExportButton(self, self.abiword_canvas)
            export_button.show()
            activity_button.props.page.insert(export_button, 2)
            toolbar_box.toolbar.insert(activity_button, 0)

            edit_toolbar = ToolbarButton()
            edit_toolbar.props.page = EditToolbar(self, toolbar_box)
            edit_toolbar.props.icon_name = 'toolbar-edit'
            edit_toolbar.props.label = _('Edit')
            toolbar_box.toolbar.insert(edit_toolbar, -1)

            view_toolbar = ToolbarButton()
            view_toolbar.props.page = ViewToolbar(self.abiword_canvas)
            view_toolbar.props.icon_name = 'toolbar-view'
            view_toolbar.props.label = _('View')
            toolbar_box.toolbar.insert(view_toolbar, -1)

            separator = gtk.SeparatorToolItem()
            toolbar_box.toolbar.insert(separator, -1)
            toolbar_box.show_all()
            self.set_toolbar_box(toolbar_box)

        if os.path.exists('/tmp/3'):
            os.remove('/tmp/3')    

            text_toolbar = ToolbarButton()
            text_toolbar.props.page = TextToolbar(self.abiword_canvas)
            text_toolbar.props.icon_name = 'format-text'
            text_toolbar.props.label = _('Text')
            toolbar_box.toolbar.insert(text_toolbar, -1)    

            para_toolbar = ToolbarButton()
            para_toolbar.props.page = ParagraphToolbar(self.abiword_canvas)
            para_toolbar.props.icon_name = 'paragraph-bar'
            para_toolbar.props.label = _('Paragraph')
            toolbar_box.toolbar.insert(para_toolbar, -1)

            list_toolbar = ToolbarButton()
            list_toolbar.props.page = ListToolbar(self.abiword_canvas)
            list_toolbar.props.icon_name = 'toolbar-bulletlist'
            list_toolbar.props.label = _('Bullet List')
            toolbar_box.toolbar.insert(list_toolbar, -1)
        
            insert_toolbar = ToolbarButton()
            insert_toolbar.props.page = InsertToolbar(self.abiword_canvas)
            insert_toolbar.props.icon_name = 'insert-table'
            insert_toolbar.props.label = _('Table')
            toolbar_box.toolbar.insert(insert_toolbar, -1)

            separator = gtk.SeparatorToolItem()
            toolbar_box.toolbar.insert(separator, -1)

            bold = ToggleToolButton('format-text-bold')
            bold.set_tooltip(_('Bold'))
            bold_id = bold.connect('clicked', lambda sender:
                    self.abiword_canvas.toggle_bold())
            self.abiword_canvas.connect('bold', lambda abi, b:
                    self._setToggleButtonState(bold, b, bold_id))
            toolbar_box.toolbar.insert(bold, -1)

            italic = ToggleToolButton('format-text-italic')
            italic.set_tooltip(_('Italic'))
            italic_id = italic.connect('clicked', lambda sender:
                    self.abiword_canvas.toggle_italic())
            self.abiword_canvas.connect('italic', lambda abi, b:
                    self._setToggleButtonState(italic, b, italic_id))
            toolbar_box.toolbar.insert(italic, -1)

            underline = ToggleToolButton('format-text-underline')
            underline.set_tooltip(_('Underline'))
            underline_id = underline.connect('clicked', lambda sender:
                    self.abiword_canvas.toggle_underline())
            self.abiword_canvas.connect('underline', lambda abi, b:
                    self._setToggleButtonState(underline, b, underline_id))
            toolbar_box.toolbar.insert(underline, -1)
#.........这里部分代码省略.........
开发者ID:Daksh,项目名称:devtutor,代码行数:103,代码来源:AbiWordActivity.py

示例9: build_toolbar

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

        toolbox = ToolbarBox()
        activity_button = ActivityToolbarButton(self)
        toolbox.toolbar.insert(activity_button, -1)
        activity_button.show()

        barra = toolbox.toolbar

        separador1 = gtk.SeparatorToolItem()
        separador1.props.draw = True
        barra.insert(separador1, 1)

        item1 = gtk.ToolItem()
        self.label_radio1 = gtk.Label()
        self.label_radio1.set_text(_('Circles between') + ' ')
        item1.add(self.label_radio1)
        barra.insert(item1, 2)

        item2 = gtk.ToolItem()
        self.cradio1 = gtk.SpinButton()
        self.cradio1.set_range(1, 20)
        self.cradio1.set_increments(1, 2)
        self.cradio1.props.value = self.radio_uno
        self.cradio1_handler = self.cradio1.connect('notify::value', self.cradio1_valor)
        item2.add(self.cradio1)
        barra.insert(item2, 3)

        item3 = gtk.ToolItem()
        self.label_and = gtk.Label()
        self.label_and.set_text(' ' + _('and') + ' ')
        item3.add(self.label_and)
        barra.insert(item3, 4)

        item4 = gtk.ToolItem()
        self.cradio2 = gtk.SpinButton()
        self.cradio2.set_range(1, 20)
        self.cradio2.set_increments(1, 2)
        self.cradio2.props.value = self.radio_dos
        self.cradio2_handler = self.cradio2.connect('notify::value', self.cradio2_valor)
        item4.add(self.cradio2)
        barra.insert(item4, 5)

        separator1 = gtk.SeparatorToolItem()
        separator1.props.draw = True
        separator1.set_expand(False)
        barra.insert(separator1,6)

        save_button = ToolButton('filesave')
        save_button.set_tooltip(_('Save Image'))
        save_button.connect('clicked', self._savebutton_cb)
        barra.insert(save_button, 7)
        save_button.show()

        separator2 = gtk.SeparatorToolItem()
        separator2.props.draw = False
        separator2.set_expand(True)
        barra.insert(separator2,8)

        stop_button = StopButton(self)
        stop_button.props.accelerator = '<Ctrl>q'
        barra.insert(stop_button, 9)
        stop_button.show()

        self.set_toolbar_box(toolbox)

        toolbox.show_all()
开发者ID:leonardcj,项目名称:pointillism,代码行数:69,代码来源:activity.py

示例10: __init__

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

        if HASTOOLBARBOX:
            self.max_participants = 1
            toolbar_box = ToolbarBox()
            self.set_toolbar_box(toolbar_box)
            activity_button = ActivityToolbarButton(self)
            toolbar_box.toolbar.insert(activity_button, 0)

            separator = gtk.SeparatorToolItem()
            separator.props.draw = True
            activity_button.props.page.insert(separator, -1)
            separator.show()

            tool = ToolButton('pdf-export')
            tool.set_tooltip(_('Portable Document Format (PDF)'))
            tool.connect('clicked', self.__export_pdf_cb)
            activity_button.props.page.insert(tool, -1)
            tool.show()

            tool = ToolButton('png-export')
            tool.set_tooltip(_('Portable Network Graphic (PNG)'))
            tool.connect('clicked', self.__export_png_cb)
            activity_button.props.page.insert(tool, -1)
            tool.show()

            tool = ToolButton('txt-export')
            tool.set_tooltip(_('Plain Text (TXT)'))
            tool.connect('clicked', self.__export_txt_cb)
            activity_button.props.page.insert(tool, -1)
            tool.show()

            tool = ToolbarButton()
            self.edit_toolbar = EditToolbar(self)
            tool.props.page = self.edit_toolbar
            tool.props.icon_name = 'toolbar-edit'
            tool.props.label = _('Edit'),
            toolbar_box.toolbar.insert(tool, -1)

            self._undo = UndoManager.UndoManager(self,
                                                 self.edit_toolbar.undo.child,
                                                 self.edit_toolbar.redo.child)

            self.__build_main_canvas_area()

            tool = ToolbarButton()
            tool.props.page = ViewToolbar(self._main_area)
            tool.props.icon_name = 'toolbar-view'
            tool.props.label = _('View'),
            toolbar_box.toolbar.insert(tool, -1)

            tool = ToolbarButton()
            self.text_format_toolbar = TextAttributesToolbar(self._main_area)
            tool.props.page = self.text_format_toolbar
            tool.props.icon_name = 'toolbar-text'
            tool.props.label = _('Text')
            toolbar_box.toolbar.insert(tool, -1)
            # self._main_area.set_text_attributes(self.text_format_toolbar)

            self.thought_toolbar = ToolbarButton()
            self.thought_toolbar.props.page = ThoughtsToolbar(self)
            self.thought_toolbar.props.icon_name = 'thought'
            self.thought_toolbar.props.label = _('Thought Type')
            toolbar_box.toolbar.insert(self.thought_toolbar, -1)

            self.action_buttons = ActionButtons(self)

            toolbar_box.show_all()

        else:
            # Use old <= 0.84 toolbar design
            toolbox = activity.ActivityToolbox(self)
            self.set_toolbox(toolbox)

            activity_toolbar = toolbox.get_activity_toolbar()
            keep_palette = activity_toolbar.keep.get_palette()

            menu_item = MenuItem(_('Portable Document Format (PDF)'))
            menu_item.connect('activate', self.__export_pdf_cb)
            keep_palette.menu.append(menu_item)
            menu_item.show()

            menu_item = MenuItem(_('Portable Network Graphic (PNG)'))
            menu_item.connect('activate', self.__export_png_cb)
            keep_palette.menu.append(menu_item)
            menu_item.show()

            menu_item = MenuItem(_('Plain Text (TXT)'))
            menu_item.connect('activate', self.__export_txt_cb)
            keep_palette.menu.append(menu_item)
            menu_item.show()

            self.edit_toolbar = EditToolbar(self)
            toolbox.add_toolbar(_('Edit'), self.edit_toolbar)
            separator = gtk.SeparatorToolItem()
            self.edit_toolbar.insert(separator, 0)
            self.edit_toolbar.show()

            self._undo = UndoManager.UndoManager(self,
#.........这里部分代码省略.........
开发者ID:Daksh,项目名称:Labyrinth,代码行数:103,代码来源:labyrinthactivity.py


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