• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python palettewindow.PaletteWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: popup

 def popup(self, immediate=False):
     button = self.expanded_button
     if button.is_expanded():
         return
     box = button.toolbar_box
     _setup_page(button.page_widget, style.COLOR_BLACK.get_gdk_color(), box.props.padding)
     PaletteWindow.popup(self, immediate)
开发者ID:rogemita,项目名称:sugar-toolkit-gtk3,代码行数:7,代码来源:toolbarbox.py


示例2: popdown

 def popdown(self, immediate=False):
     if immediate:
         self._secondary_anim.stop()
         # to suppress glitches while later re-opening
         self.set_palette_state(self.PRIMARY)
         if self._widget:
             self._widget.size_request()
     PaletteWindow.popdown(self, immediate)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:8,代码来源:palette.py


示例3: __init__

    def __init__(self, **kwargs):
        PaletteWindow.__init__(self, **kwargs)
        self._has_focus = False

        group = palettegroup.get_group('default')
        group.connect('popdown', self.__group_popdown_cb)
        self.set_group_id('toolbarbox')

        self._widget = _PaletteWindowWidget()
        self._widget.set_border_width(0)
        self._setup_widget()

        self._widget.connect('realize', self._realize_cb)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:13,代码来源:toolbarbox.py


示例4: popup

    def popup(self, immediate=False, state=None):
        if self._invoker is not None:
            self._update_full_request()

        PaletteWindow.popup(self, immediate)

        if state is None:
            state = self.PRIMARY
        self.set_palette_state(state)

        if state == self.PRIMARY:
            self._secondary_anim.start()
        else:
            self._secondary_anim.stop()
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:14,代码来源:palette.py


示例5: popdown

    def popdown(self, immediate=False, state=None):
        '''
        Popdown (or show the full contents of) the palette.

        Keyword Args:
            immediate (bool): if True, the palette will be shown instantly (as
                if the user right clicked the item).  If False, the palette
                will be shown after the usual activation wait time.

        .. deprecated:: 0.109
            The state keyword argument is deprecated.  The old
            secondary state has become the only state.
        '''
        if immediate:
            if self._widget:
                self._widget.size_request()
        PaletteWindow.popdown(self, immediate)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:17,代码来源:palette.py


示例6: on_enter

 def on_enter(self):
     PaletteWindow.on_enter(self)
     self._secondary_anim.start()
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:3,代码来源:palette.py


示例7: _setup_widget

 def _setup_widget(self):
     PaletteWindow._setup_widget(self)
     self._widget.connect('destroy', self.__destroy_cb)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:3,代码来源:palette.py


示例8: __init__

    def __init__(self, label=None, accel_path=None,
                 text_maxlen=60, **kwargs):
        # DEPRECATED: label is passed with the primary-text property,
        # accel_path is set via the invoker property

        self._primary_text = None
        self._secondary_text = None
        self._icon = None
        self._icon_visible = True
        self._palette_state = self.PRIMARY

        self._primary_box = Gtk.HBox()
        self._primary_box.show()

        self._icon_box = Gtk.HBox()
        self._icon_box.set_size_request(style.GRID_CELL_SIZE, -1)
        self._primary_box.pack_start(self._icon_box, False, True, 0)

        labels_box = Gtk.VBox()
        self._label_alignment = Gtk.Alignment(xalign=0, yalign=0.5, xscale=1,
                                              yscale=0.33)
        self._label_alignment.set_padding(0, 0, style.DEFAULT_SPACING,
                                          style.DEFAULT_SPACING)
        self._label_alignment.add(labels_box)
        self._label_alignment.show()
        self._primary_box.pack_start(self._label_alignment, True, True, 0)
        labels_box.show()

        self._label = Gtk.AccelLabel(label='')
        self._label.set_alignment(0, 0.5)

        if text_maxlen > 0:
            self._label.set_max_width_chars(text_maxlen)
            self._label.set_ellipsize(Pango.EllipsizeMode.MIDDLE)
        labels_box.pack_start(self._label, True, True, 0)

        self._secondary_label = Gtk.Label()
        self._secondary_label.set_alignment(0, 0.5)

        if text_maxlen > 0:
            self._secondary_label.set_max_width_chars(text_maxlen)
            self._secondary_label.set_ellipsize(Pango.EllipsizeMode.END)

        labels_box.pack_start(self._secondary_label, True, True, 0)

        self._secondary_box = Gtk.VBox()

        self._separator = Gtk.HSeparator()
        self._secondary_box.pack_start(self._separator, True, True, 0)

        self._secondary_anim = animator.Animator(2.0, 10)
        self._secondary_anim.add(_SecondaryAnimation(self))

        # we init after initializing all of our containers
        PaletteWindow.__init__(self, **kwargs)

        self._full_request = [0, 0]
        self._content = None

        # we set these for backward compatibility
        if label is not None:
            self.props.primary_text = label

        self._add_content()

        self.action_bar = PaletteActionBar()
        self._secondary_box.pack_start(self.action_bar, True, True, 0)
        self.action_bar.show()

        self.connect('notify::invoker', self.__notify_invoker_cb)
        self.connect('popdown', self.__popdown_cb)

        # Default to a normal window palette
        self._content_widget = None
        self.set_content(None)
开发者ID:worr,项目名称:sugar-toolkit-gtk3-1,代码行数:75,代码来源:palette.py


示例9: on_leave

 def on_leave(self):
     PaletteWindow.on_enter(self)
     self._set_focus(False)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py


示例10: on_enter

 def on_enter(self):
     PaletteWindow.on_enter(self)
     self._set_focus(True)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py


示例11: on_invoker_leave

 def on_invoker_leave(self):
     PaletteWindow.on_invoker_leave(self)
     self._set_focus(False)
开发者ID:ceibal-tatu,项目名称:sugar-toolkit-gtk3,代码行数:3,代码来源:toolbarbox.py


示例12: on_enter

 def on_enter(self):
     PaletteWindow.on_enter(self)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:2,代码来源:palette.py


示例13: popup

    def popup(self, immediate=False):
        if self._invoker is not None:
            self._update_full_request()

        PaletteWindow.popup(self, immediate)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:5,代码来源:palette.py


示例14: __init__

    def __init__(self, label=None, accel_path=None,
                 text_maxlen=style.MENU_WIDTH_CHARS, **kwargs):
        # DEPRECATED: label is passed with the primary-text property,
        # accel_path is set via the invoker property

        self._primary_text = None
        self._secondary_text = None
        self._icon = None
        self._icon_visible = True

        self._primary_event_box = Gtk.EventBox()
        self._primary_event_box.show()
        self._primary_box = Gtk.HBox()
        self._primary_event_box.add(self._primary_box)
        self._primary_box.show()

        self._icon_box = Gtk.HBox()
        self._icon_box.set_size_request(style.GRID_CELL_SIZE, -1)
        self._primary_box.pack_start(self._icon_box, False, True, 0)

        labels_box = Gtk.VBox()
        self._label_alignment = Gtk.Alignment(xalign=0, yalign=0.5, xscale=1,
                                              yscale=0.33)
        self._label_alignment.set_padding(
            style.DEFAULT_SPACING, style.DEFAULT_SPACING,
            style.DEFAULT_SPACING, style.DEFAULT_SPACING)
        self._label_alignment.add(labels_box)
        self._label_alignment.show()
        self._primary_box.pack_start(self._label_alignment, True, True, 0)
        labels_box.show()

        self._label = Gtk.AccelLabel(label='')
        self._label.set_alignment(0, 0.5)

        if text_maxlen > 0:
            self._label.set_max_width_chars(text_maxlen)
            self._label.set_ellipsize(style.ELLIPSIZE_MODE_DEFAULT)
        labels_box.pack_start(self._label, True, True, 0)
        self._primary_event_box.connect('button-release-event',
                                        self.__button_release_event_cb)
        self._primary_event_box.set_events(Gdk.EventMask.BUTTON_RELEASE_MASK)

        self._secondary_label = Gtk.Label()
        self._secondary_label.set_alignment(0, 0.5)
        labels_box.pack_start(self._secondary_label, True, True, 0)

        self._secondary_box = Gtk.VBox()

        self._separator = Gtk.HSeparator()
        self._secondary_box.pack_start(self._separator, True, True, 0)
        self._secondary_box.show()

        # we init after initializing all of our containers
        PaletteWindow.__init__(self, **kwargs)

        self._full_request = [0, 0]
        self._content = None

        # we set these for backward compatibility
        if label is not None:
            self.props.primary_text = label

        self._add_content()

        self.action_bar = PaletteActionBar()
        self._secondary_box.pack_start(self.action_bar, True, True, 0)
        self.action_bar.show()

        self.connect('notify::invoker', self.__notify_invoker_cb)

        # Default to a normal window palette
        self._content_widget = None
        self.set_content(None)
开发者ID:i5o,项目名称:sugar-toolkit-gtk3,代码行数:73,代码来源:palette.py


示例15: popdown

 def popdown(self, immediate=False):
     if immediate:
         if self._widget:
             self._widget.size_request()
     PaletteWindow.popdown(self, immediate)
开发者ID:AbrahmAB,项目名称:sugar-toolkit-gtk3,代码行数:5,代码来源:palette.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python radiotoolbutton.RadioToolButton类代码示例发布时间:2022-05-27
下一篇:
Python palettemenu.PaletteMenuItemSeparator类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap