dialogs.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:games_nebula 作者: yancharkin 项目源码 文件源码
def create_question(self, option_name):

        message_dialog = Gtk.MessageDialog(
            None,
            0,
            Gtk.MessageType.QUESTION,
            Gtk.ButtonsType.YES_NO,
            _("Install") + " " + option_name + "?"
            )
        message_dialog.set_default_size(360, 120)

        content_area = message_dialog.get_content_area()
        content_area.set_property('margin_top', 10)
        content_area.set_property('margin_bottom', 10)
        content_area.set_property('margin_left', 10)
        content_area.set_property('margin_right', 10)

        action_area = message_dialog.get_action_area()
        action_area.set_spacing(10)

        response = message_dialog.run()
        message_dialog.destroy()

        if response == Gtk.ResponseType.YES:
            return 'Yes'
        elif response == Gtk.ResponseType.NO:
            return 'No'
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号