本文整理汇总了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()
示例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()
示例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)
示例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)
示例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)
示例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)