本文整理汇总了Python中sugar3.graphics.alert.Alert.show_all方法的典型用法代码示例。如果您正苦于以下问题:Python Alert.show_all方法的具体用法?Python Alert.show_all怎么用?Python Alert.show_all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sugar3.graphics.alert.Alert
的用法示例。
在下文中一共展示了Alert.show_all方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __create_empty_file_cb
# 需要导入模块: from sugar3.graphics.alert import Alert [as 别名]
# 或者: from sugar3.graphics.alert.Alert import show_all [as 别名]
def __create_empty_file_cb(self, button):
alert = Alert()
alert.props.title = _('Create new file')
alert.props.msg = _('Select the name of the file')
# HACK
alert._hbox.remove(alert._buttons_box)
alert.entry = Gtk.Entry()
alert._hbox.pack_start(alert.entry, True, True, 0)
alert._buttons_box = Gtk.HButtonBox()
alert._buttons_box.set_layout(Gtk.ButtonBoxStyle.END)
alert._buttons_box.set_spacing(style.DEFAULT_SPACING)
alert._hbox.pack_start(alert._buttons_box, True, True, 0)
icon = Icon(icon_name='dialog-cancel')
alert.add_button(Gtk.ResponseType.CANCEL, _('Cancel'), icon)
icon = Icon(icon_name='dialog-ok')
alert.add_button(Gtk.ResponseType.OK, _('Ok'), icon)
alert.show_all()
#
self.add_alert(alert)
alert.connect('response', self.__create_file_alert_cb)
示例2: _show_alert
# 需要导入模块: from sugar3.graphics.alert import Alert [as 别名]
# 或者: from sugar3.graphics.alert.Alert import show_all [as 别名]
def _show_alert(self, title, msg):
_stop_alert = Alert()
_stop_alert.props.title = title
_stop_alert.props.msg = msg
_stop_alert.add_button(Gtk.ResponseType.OK, _('Ok'),
Icon(icon_name='dialog-ok'))
# Remove other alerts
for alert in self._alerts:
self.remove_alert(alert)
self.add_alert(_stop_alert)
_stop_alert.connect('response', self.__stop_response_cb)
_stop_alert.show_all()
示例3: __pdf_alert
# 需要导入模块: from sugar3.graphics.alert import Alert [as 别名]
# 或者: from sugar3.graphics.alert.Alert import show_all [as 别名]
def __pdf_alert(self, object_id):
alert = Alert()
alert.props.title = _("Page saved")
alert.props.msg = _("The page has been saved as PDF to journal")
alert.add_button(Gtk.ResponseType.APPLY, _("Show in Journal"), Icon(icon_name="zoom-activity"))
alert.add_button(Gtk.ResponseType.OK, _("Ok"), Icon(icon_name="dialog-ok"))
# Remove other alerts
for alert in self._activity._alerts:
self._activity.remove_alert(alert)
self._activity.add_alert(alert)
alert.connect("response", self.__pdf_response_alert, object_id)
alert.show_all()
示例4: __pdf_alert
# 需要导入模块: from sugar3.graphics.alert import Alert [as 别名]
# 或者: from sugar3.graphics.alert.Alert import show_all [as 别名]
def __pdf_alert(self, object_id):
alert = Alert()
alert.props.title = _('Page saved')
alert.props.msg = _('The page has been saved as PDF to journal')
alert.add_button(Gtk.ResponseType.APPLY,
_('Show in Journal'),
Icon(icon_name='zoom-activity'))
alert.add_button(Gtk.ResponseType.OK, _('Ok'),
Icon(icon_name='dialog-ok'))
# Remove other alerts
for alert in self._activity._alerts:
self._activity.remove_alert(alert)
self._activity.add_alert(alert)
alert.connect('response', self.__pdf_response_alert, object_id)
alert.show_all()
示例5: _journal_alert
# 需要导入模块: from sugar3.graphics.alert import Alert [as 别名]
# 或者: from sugar3.graphics.alert.Alert import show_all [as 别名]
def _journal_alert(self, object_id, title, msg):
alert = Alert()
alert.props.title = title
alert.props.msg = msg
bundle = get_bundle(object_id=object_id)
if bundle is not None:
alert.add_button(Gtk.ResponseType.ACCEPT,
_('Open with {}').format(bundle.get_name()),
Icon(file=bundle.get_icon()))
else:
alert.add_button(Gtk.ResponseType.APPLY,
_('Show in Journal'),
Icon(icon_name='zoom-activity'))
alert.add_button(Gtk.ResponseType.OK, _('Ok'),
Icon(icon_name='dialog-ok'))
# Remove other alerts
for alert in self._alerts:
self.remove_alert(alert)
self.add_alert(alert)
alert.connect('response', self.__alert_response_cb, object_id)
alert.show_all()