当前位置: 首页>>代码示例>>Python>>正文


Python Alert.show_all方法代码示例

本文整理汇总了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)
开发者ID:svineet,项目名称:develop-activity,代码行数:27,代码来源:develop_app.py

示例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()
开发者ID:sugarlabs,项目名称:edit-fonts-activity,代码行数:15,代码来源:EditFonts.py

示例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()
开发者ID:richaseh,项目名称:browse,代码行数:17,代码来源:webtoolbar.py

示例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()
开发者ID:sugarlabs,项目名称:Gmail,代码行数:20,代码来源:webtoolbar.py

示例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()
开发者ID:AbrahmAB,项目名称:bibliography-activity,代码行数:26,代码来源:activity.py


注:本文中的sugar3.graphics.alert.Alert.show_all方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。