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


Python ToolButton.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, **kwargs):
        ToolButton.__init__(self, **kwargs)
        self.selected_button = None

        if self.props.palette:
            self.__palette_cb(None, None)

        self.connect("notify::palette", self.__palette_cb)
开发者ID:tchx84,项目名称:debian-pkg-sugar-toolkit,代码行数:10,代码来源:radiopalette.py

示例2: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, activity, **kwargs):
        ToolButton.__init__(self, **kwargs)

        icon = _create_activity_icon(activity.metadata)
        self.set_icon_widget(icon)
        icon.show()

        self.props.tooltip = activity.metadata['title']
        activity.metadata.connect('updated', self.__jobject_updated_cb)
开发者ID:Daksh,项目名称:sugar-toolkit,代码行数:11,代码来源:widgets.py

示例3: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, activity, abi):
        ToolButton.__init__(self, "document-save")
        self.props.tooltip = _("Export")
        self.props.label = _("Export")

        for i in self._EXPORT_FORMATS:
            menu_item = MenuItem(i["title"])
            menu_item.connect("activate", self.__activate_cb, activity, abi, i)
            self.props.palette.menu.append(menu_item)
            menu_item.show()
开发者ID:Daksh,项目名称:devtutor,代码行数:12,代码来源:widgets.py

示例4: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, page=None, **kwargs):
        ToolButton.__init__(self, **kwargs)

        self.page_widget = None

        self.set_page(page)

        self.connect('clicked',
                lambda widget: self.set_expanded(not self.is_expanded()))

        self.connect('hierarchy-changed', self.__hierarchy_changed_cb)
开发者ID:Daksh,项目名称:sugar-toolkit,代码行数:13,代码来源:toolbarbox.py

示例5: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, file_transfer):
        ToolButton.__init__(self)

        self.file_transfer = file_transfer
        file_transfer.connect('notify::state', self.__notify_state_cb)

        icon = Icon()
        self.props.icon_widget = icon
        icon.show()

        self.notif_icon = NotificationIcon()
        self.notif_icon.connect('button-release-event',
                                 self.__button_release_event_cb)

        self.connect('clicked', self.__button_clicked_cb)
开发者ID:nemesiscodex,项目名称:JukyOS-sugar,代码行数:17,代码来源:activitiestray.py

示例6: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, device):
        ToolButton.__init__(self)

        self._bus = dbus.SystemBus()
        self._device = device
        self._device_props = None
        self._flags = 0
        self._ssid = ''
        self._display_name = ''
        self._mode = network.NM_802_11_MODE_UNKNOWN
        self._strength = 0
        self._frequency = 0
        self._device_state = None
        self._color = None
        self._active_ap_op = None

        self._icon = PulsingIcon()
        self._icon.props.icon_name = get_icon_state('network-wireless', 0)
        self._inactive_color = xocolor.XoColor(
            '%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(),
                       style.COLOR_TRANSPARENT.get_svg()))
        self._icon.props.pulse_color = self._inactive_color
        self._icon.props.base_color = self._inactive_color

        self.set_icon_widget(self._icon)
        self._icon.show()

        self.set_palette_invoker(FrameWidgetInvoker(self))
        self._palette = WirelessPalette(self._display_name)
        self._palette.connect('deactivate-connection',
                              self.__deactivate_connection_cb)
        self.set_palette(self._palette)
        self._palette.set_group_id('frame')

        self._device_props = dbus.Interface(self._device,
                                            dbus.PROPERTIES_IFACE)
        self._device_props.GetAll(network.NM_DEVICE_IFACE, byte_arrays=True,
                              reply_handler=self.__get_device_props_reply_cb,
                              error_handler=self.__get_device_props_error_cb)

        self._device_props.Get(network.NM_WIRELESS_IFACE, 'ActiveAccessPoint',
                               reply_handler=self.__get_active_ap_reply_cb,
                               error_handler=self.__get_active_ap_error_cb)

        self._bus.add_signal_receiver(self.__state_changed_cb,
                                      signal_name='StateChanged',
                                      path=self._device.object_path,
                                      dbus_interface=network.NM_DEVICE_IFACE)
开发者ID:nemesiscodex,项目名称:JukyOS-sugar,代码行数:50,代码来源:network.py

示例7: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
 def __init__(self,jobject=None):
     LicenseWidget.__init__(self,"#ffffff,#ffffff")
     self._jobject = jobject
     if jobject:
         self._color_selected = XoColor(self._jobject.metadata['icon-color'])
     else:
         self._color_selected = profile.get_color()
     default, license = self.load_license()
     icon_name = self.uri_to_icon(license)
     ToolButton.__init__(self)
     icon = Icon(icon_name,icon_size=self._icon_size,xo_color=XoColor("#ffffff,#ffffff"))
     icon.show()
     self.set_icon_widget(icon)
     self.props.sensitive = True
     self.set_tooltip(self._format_tooltip(license))
     self.make_menu(self.get_palette(),XoColor("#ffffff,#ffffff"),self._color_selected,icon_name)
开发者ID:cc-archive,项目名称:liblicense-sugar,代码行数:18,代码来源:sugar.py

示例8: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self, icon_name, scroll_direction):
        ToolButton.__init__(self)
        self._viewport = None

        self._scroll_direction = scroll_direction

        self.set_size_request(style.GRID_CELL_SIZE, style.GRID_CELL_SIZE)

        self.icon = Icon(icon_name=icon_name, icon_size=gtk.ICON_SIZE_SMALL_TOOLBAR)
        # The alignment is a hack to work around gtk.ToolButton code
        # that sets the icon_size when the icon_widget is a gtk.Image
        alignment = gtk.Alignment(0.5, 0.5)
        alignment.add(self.icon)
        self.set_icon_widget(alignment)
        alignment.show_all()

        self.connect("clicked", self._clicked_cb)
开发者ID:tchx84,项目名称:debian-pkg-sugar-toolkit,代码行数:19,代码来源:tray.py

示例9: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
    def __init__(self):
        ToolButton.__init__(self)

        self._property = 'timestamp'
        self._order = gtk.SORT_ASCENDING

        self.props.tooltip = _('Sort view')
        self.props.icon_name = 'view-lastedit'

        for property_, icon, label in self._SORT_OPTIONS:
            button = MenuItem(icon_name=icon, text_label=label)
            button.connect('activate',
                           self.__sort_type_changed_cb,
                           property_,
                           icon)
            button.show()
            self.props.palette.menu.insert(button, -1)
开发者ID:nemesiscodex,项目名称:JukyOS-sugar,代码行数:19,代码来源:journaltoolbox.py

示例10: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
 def __init__(self, toolbar, name, uri):
     self._name = name
     self._uri = uri
     self._toolbar = toolbar
     self._browser = toolbar._activity._browser
 
     # set up the button
     ToolButton.__init__(self, 'bookmarklet')
     self.connect('clicked', self.__clicked_cb)
     toolbar.insert(self, -1)
     
     # and its palette
     palette = Palette(name, text_maxlen=50)
     self.set_palette(palette)
     
     menu_item = gtk.MenuItem(_('Remove'))
     menu_item.connect('activate', self.__remove_cb)
     palette.menu.append(menu_item)
     menu_item.show()
     
     self.show()
开发者ID:lucian1900,项目名称:Webified,代码行数:23,代码来源:bookmarklettoolbar.py

示例11: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
 def __init__(self, **kwargs):
     ToolButton.__init__(self, "back", **kwargs)
     self.props.tooltip = _("Back")
     self.props.accelerator = "<Alt>Left"
开发者ID:Daksh,项目名称:devtutor,代码行数:6,代码来源:activity.py

示例12: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
 def __init__(self, activity, **kwargs):
     ToolButton.__init__(self, "dialog-apply", **kwargs)
     self.props.tooltip = _("Score Card")
     self.props.accelerator = "<Ctrl>Q"
     self.connect("clicked", self.__show_score_win, activity)
开发者ID:Gopaal,项目名称:2014-interns,代码行数:7,代码来源:activity.py

示例13: __init__

# 需要导入模块: from sugar.graphics.toolbutton import ToolButton [as 别名]
# 或者: from sugar.graphics.toolbutton.ToolButton import __init__ [as 别名]
 def __init__(self):
     ToolButton.__init__(self)
开发者ID:Daksh,项目名称:xophoto,代码行数:4,代码来源:photo_toolbar.py


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