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