本文整理汇总了Python中sugar3.graphics.menuitem.MenuItem.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python MenuItem.__init__方法的具体用法?Python MenuItem.__init__怎么用?Python MenuItem.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.menuitem.MenuItem
的用法示例。
在下文中一共展示了MenuItem.__init__方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, account, get_uid_list, is_active):
MenuItem.__init__(self, ACCOUNT_DESCRIPTION)
self._account = account
self.set_image(Icon(icon_name=ACCOUNT_ICON,
icon_size=Gtk.IconSize.MENU))
self.show()
self._get_uid_list = get_uid_list
self.connect('activate', self.upload_file)
示例2: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, account, get_uid_list, is_active):
MenuItem.__init__(self, ACCOUNT_NAME)
self._account = account
self.set_image(Icon(icon_name=ACCOUNT_ICON,
icon_size=Gtk.IconSize.MENU))
self.show()
self._get_uid_list = get_uid_list
self.connect('activate', self.__share_menu_cb)
示例3: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, webaccount, is_active):
MenuItem.__init__(self, ACCOUNT_NAME)
self._account = webaccount
self._is_active = is_active
self.set_image(Icon(icon_name=ACCOUNT_ICON,
icon_size=Gtk.IconSize.MENU))
self.show()
self.set_sensitive(False)
示例4: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, account, get_uid_list, is_active):
MenuItem.__init__(self, ACCOUNT_NAME)
self._facebook = account
if is_active:
icon_name = 'facebook-share'
else:
icon_name = 'facebook-share-insensitive'
self.set_image(Icon(icon_name=icon_name,
icon_size=Gtk.IconSize.MENU))
self.show()
self._get_uid_list = get_uid_list
self.connect('activate', self._facebook_share_menu_cb)
示例5: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, account, is_active):
MenuItem.__init__(self, ACCOUNT_NAME)
self._facebook = account
self._is_active = is_active
self._metadata = None
if is_active:
icon_name = 'facebook-refresh'
else:
icon_name = 'facebook-refresh-insensitive'
self.set_image(Icon(icon_name=icon_name,
icon_size=Gtk.IconSize.MENU))
self.show()
self.connect('activate', self._fb_refresh_menu_clicked_cb)
示例6: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self):
MenuItem.__init__(self, text_label=ACCOUNT_NAME)
self.show()
示例7: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, get_uid_list_cb):
MenuItem.__init__(self, _('Clipboard'))
self._temp_file_path = None
self._get_uid_list_cb = get_uid_list_cb
self.connect('activate', self.__copy_to_clipboard_cb)
示例8: __init__
# 需要导入模块: from sugar3.graphics.menuitem import MenuItem [as 别名]
# 或者: from sugar3.graphics.menuitem.MenuItem import __init__ [as 别名]
def __init__(self, metadata):
MenuItem.__init__(self, _('Clipboard'))
self._temp_file_path = None
self._metadata = metadata
self.connect('activate', self.__copy_to_clipboard_cb)