__init__.py 文件源码

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

项目:x-mario-center 作者: fossasia 项目源码 文件源码
def __init__(self,
                 parent=None,
                 title="",
                 primary=None,
                 secondary=None,
                 details=None,
                 buttons=Gtk.ButtonsType.OK,
                 type=Gtk.MessageType.INFO):
        Gtk.MessageDialog.__init__(self, parent, 0, type, buttons, primary)
        self.set_title(title)
        if secondary:
            self.format_secondary_markup(secondary)
        if details:
            textview = Gtk.TextView()
            textview.get_buffer().set_text(details)
            scroll = Gtk.ScrolledWindow()
            scroll.set_size_request(500, 300)
            scroll.set_policy(Gtk.PolicyType.AUTOMATIC,
                Gtk.PolicyType.AUTOMATIC)
            scroll.add(textview)
            expand = Gtk.Expander().new(_("Details"))
            expand.add(scroll)
            expand.show_all()
            self.get_content_area().pack_start(expand, True, True, 0)
        if parent:
            self.set_modal(True)
            self.set_property("skip-taskbar-hint", True)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号