當前位置: 首頁>>代碼示例>>Python>>正文


Python RadioToolButton.__init__方法代碼示例

本文整理匯總了Python中sugar.graphics.radiotoolbutton.RadioToolButton.__init__方法的典型用法代碼示例。如果您正苦於以下問題:Python RadioToolButton.__init__方法的具體用法?Python RadioToolButton.__init__怎麽用?Python RadioToolButton.__init__使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在sugar.graphics.radiotoolbutton.RadioToolButton的用法示例。


在下文中一共展示了RadioToolButton.__init__方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self, home_activity, group):
        RadioToolButton.__init__(self, group=group)

        self.set_palette_invoker(FrameWidgetInvoker(self))
        self.palette_invoker.cache_palette = False

        self._home_activity = home_activity
        self._notify_launch_hid = None

        self._icon = PulsingIcon()
        self._icon.props.base_color = home_activity.get_icon_color()
        self._icon.props.pulse_color = \
                XoColor('%s,%s' % (style.COLOR_BUTTON_GREY.get_svg(),
                                   style.COLOR_TOOLBAR_GREY.get_svg()))
        if home_activity.get_icon_path():
            self._icon.props.file = home_activity.get_icon_path()
        else:
            self._icon.props.icon_name = 'image-missing'
        self.set_icon_widget(self._icon)
        self._icon.show()

        if home_activity.props.launch_status == shell.Activity.LAUNCHING:
            self._icon.props.pulsing = True
            self._notify_launch_hid = home_activity.connect( \
                    'notify::launch-status', self.__notify_launch_status_cb)
        elif home_activity.props.launch_status == shell.Activity.LAUNCH_FAILED:
            self._on_failed_launch()
開發者ID:nemesiscodex,項目名稱:JukyOS-sugar,代碼行數:29,代碼來源:activitiestray.py

示例2: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self, file_name, document_path, title):
        RadioToolButton.__init__(self)

        self._document_path = document_path
        self._title = title
        self._jobject = None

        self.props.tooltip = _('Instance Source')

        client = gconf.client_get_default()
        self._color = client.get_string('/desktop/sugar/user/color')
        icon = Icon(file=file_name,
                    icon_size=gtk.ICON_SIZE_LARGE_TOOLBAR,
                    xo_color=XoColor(self._color))
        self.set_icon_widget(icon)
        icon.show()

        menu_item = MenuItem(_('Keep'))
        icon = Icon(icon_name='document-save', icon_size=gtk.ICON_SIZE_MENU, 
                    xo_color=XoColor(self._color))
        menu_item.set_image(icon)

        menu_item.connect('activate', self.__keep_in_journal_cb)
        self.props.palette.menu.append(menu_item)
        menu_item.show()
開發者ID:lucian1900,項目名稱:Webified,代碼行數:27,代碼來源:viewsource.py

示例3: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self, cb_object, group):
        RadioToolButton.__init__(self, group=group)

        self.props.palette_invoker = FrameWidgetInvoker(self)

        self._cb_object = cb_object
        self.owns_clipboard = False
        self.props.sensitive = False
        self.props.active = False
        self._notif_icon = None
        self._current_percent = None

        self._icon = Icon()
        client = gconf.client_get_default()
        color = XoColor(client.get_string('/desktop/sugar/user/color'))
        self._icon.props.xo_color = color
        self.set_icon_widget(self._icon)
        self._icon.show()

        cb_service = clipboard.get_instance()
        cb_service.connect('object-state-changed',
                           self._object_state_changed_cb)
        cb_service.connect('object-selected', self._object_selected_cb)

        child = self.get_child()
        child.connect('drag_data_get', self._drag_data_get_cb)
        self.connect('notify::active', self._notify_active_cb)
開發者ID:nemesiscodex,項目名稱:JukyOS-sugar,代碼行數:29,代碼來源:clipboardicon.py

示例4: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self, mount_point):
        RadioToolButton.__init__(self)

        self.mount_point = mount_point

        self.drag_dest_set(gtk.DEST_DEFAULT_ALL,
                           [('journal-object-id', 0, 0)],
                           gtk.gdk.ACTION_COPY)
        self.connect('drag-data-received', self._drag_data_received_cb)
開發者ID:nemesiscodex,項目名稱:JukyOS-sugar,代碼行數:11,代碼來源:volumestoolbar.py

示例5: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self):
        RadioToolButton.__init__(self)

        self.props.tooltip = _('Pathway view')
        self.props.accelerator = _('<Ctrl>3')
        self.props.group = None

        favorites_settings = favoritesview.get_settings()
        self._layout = favorites_settings.layout
        self._update_icon()

        # someday, this will be a gtk.Table()
        layouts_grid = gtk.HBox()
        layout_item = None
        for layoutid, layoutclass in sorted(favoritesview.LAYOUT_MAP.items()):
            layout_item = RadioToolButton(icon_name=layoutclass.icon_name,
                                          group=layout_item, active=False)
            if layoutid == self._layout:
                layout_item.set_active(True)
            layouts_grid.pack_start(layout_item, fill=False)
            layout_item.connect('toggled', self.__layout_activate_cb,
                                layoutid)
        layouts_grid.show_all()
        self.props.palette.set_content(layouts_grid)
開發者ID:davidmason,項目名稱:glycogen,代碼行數:26,代碼來源:pathwaybutton.py

示例6: __init__

# 需要導入模塊: from sugar.graphics.radiotoolbutton import RadioToolButton [as 別名]
# 或者: from sugar.graphics.radiotoolbutton.RadioToolButton import __init__ [as 別名]
    def __init__(self, abi, abi_signal, do_abi_cb, on_abi_cb=None, **kwargs):
        RadioToolButton.__init__(self, **kwargs)

        self._abi_handler = abi.connect(abi_signal, self.__abi_cb, abi_signal, on_abi_cb)
        self._toggled_handler = self.connect("toggled", self.__toggled_cb, abi, do_abi_cb)
開發者ID:Daksh,項目名稱:devtutor,代碼行數:7,代碼來源:widgets.py


注:本文中的sugar.graphics.radiotoolbutton.RadioToolButton.__init__方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。