本文整理汇总了Python中sugar3.graphics.icon.CanvasIcon.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python CanvasIcon.__init__方法的具体用法?Python CanvasIcon.__init__怎么用?Python CanvasIcon.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.icon.CanvasIcon
的用法示例。
在下文中一共展示了CanvasIcon.__init__方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, picker):
CanvasIcon.__init__(self, icon_name='computer-xo',
pixel_size=style.XLARGE_ICON_SIZE)
self._picker = picker
self._color = None
self.connect('button_press_event', self.__pressed_cb, picker)
示例2: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, model, file_name, xo_color,
size=style.STANDARD_ICON_SIZE):
CanvasIcon.__init__(self, file_name=file_name,
xo_color=xo_color, pixel_size=size)
self._model = model
self.palette_invoker.props.toggle_palette = True
示例3: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, model, file_name, xo_color,
size=style.STANDARD_ICON_SIZE):
CanvasIcon.__init__(self, file_name=file_name,
xo_color=xo_color, pixel_size=size)
self._model = model
self.connect('button-release-event',
self.__button_release_event_cb)
示例4: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, interval=_INTERVAL, **kwargs):
self._pulser = Pulser(self, interval)
self._base_color = None
self._pulse_color = None
self._paused = False
self._pulsing = False
CanvasIcon.__init__(self, **kwargs)
self.connect('destroy', self.__destroy_cb)
示例5: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, buddy, pixel_size=style.STANDARD_ICON_SIZE):
CanvasIcon.__init__(self, icon_name='computer-xo',
pixel_size=pixel_size)
self._filtered = False
self._buddy = buddy
self._buddy.connect('notify::present', self.__buddy_notify_present_cb)
self._buddy.connect('notify::color', self.__buddy_notify_color_cb)
self.palette_invoker.props.toggle_palette = True
self.palette_invoker.cache_palette = False
self._update_color()
示例6: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self):
CanvasIcon.__init__(self, icon_name='activity-journal',
pixel_size=style.STANDARD_ICON_SIZE, cache=True)
self._home_model = shell.get_model()
self._home_activity = self._home_model.get_active_activity()
if self._home_activity is not None:
self._update()
self._home_model.connect('active-activity-changed',
self.__active_activity_changed_cb)
self.connect_after('activate', self.__activate_cb)
示例7: __init__
# 需要导入模块: from sugar3.graphics.icon import CanvasIcon [as 别名]
# 或者: from sugar3.graphics.icon.CanvasIcon import __init__ [as 别名]
def __init__(self, activity_info):
CanvasIcon.__init__(self, cache=True,
file_name=activity_info.get_icon())
self._activity_info = activity_info
self._journal_entries = []
self._resume_mode = True
self.connect_after('activate', self.__button_activate_cb)
datastore.updated.connect(self.__datastore_listener_updated_cb)
datastore.deleted.connect(self.__datastore_listener_deleted_cb)
self._refresh()
self._update()