本文整理汇总了Python中sugar3.activity.widgets.StopButton.connect方法的典型用法代码示例。如果您正苦于以下问题:Python StopButton.connect方法的具体用法?Python StopButton.connect怎么用?Python StopButton.connect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.activity.widgets.StopButton
的用法示例。
在下文中一共展示了StopButton.connect方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _incompatible
# 需要导入模块: from sugar3.activity.widgets import StopButton [as 别名]
# 或者: from sugar3.activity.widgets.StopButton import connect [as 别名]
def _incompatible(self):
''' Display abbreviated activity user interface with alert '''
toolbox = ToolbarBox()
stop = StopButton(self)
toolbox.toolbar.add(stop)
self.set_toolbar_box(toolbox)
title = _('Activity not compatible with this system.')
msg = _('Please downgrade activity and try again.')
alert = Alert(title=title, msg=msg)
alert.add_button(0, 'Stop', Icon(icon_name='activity-stop'))
self.add_alert(alert)
label = Gtk.Label(_('Uh oh, WebKit2 is too old. '
'Browse-200 and later require WebKit2 API 4.0, '
'sorry!'))
self.set_canvas(label)
'''
Workaround: start Terminal activity, then type
sugar-erase-bundle org.laptop.WebActivity
then in My Settings, choose Software Update, which will offer
older Browse.
'''
alert.connect('response', self.__incompatible_response_cb)
stop.connect('clicked', self.__incompatible_stop_clicked_cb,
alert)
self.show_all()
示例2: _incompatible
# 需要导入模块: from sugar3.activity.widgets import StopButton [as 别名]
# 或者: from sugar3.activity.widgets.StopButton import connect [as 别名]
def _incompatible(self):
''' Display abbreviated activity user interface with alert '''
toolbox = ToolbarBox()
stop = StopButton(self)
toolbox.toolbar.add(stop)
self.set_toolbar_box(toolbox)
title = _('Activity not compatible with this system.')
msg = _('Please downgrade activity and try again.')
alert = Alert(title=title, msg=msg)
alert.add_button(0, 'Stop', Icon(icon_name='activity-stop'))
self.add_alert(alert)
label = Gtk.Label(_('Uh oh, GStreamer is too old.'))
self.set_canvas(label)
alert.connect('response', self.__incompatible_response_cb)
stop.connect('clicked', self.__incompatible_stop_clicked_cb,
alert)
self.show_all()