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)
评论列表
文章目录