better way to handle close button in about dialog

This commit is contained in:
Yann Leboulanger 2014-03-23 16:24:59 +01:00
parent f36dddc8ef
commit 6176e5c41f

View file

@ -1344,12 +1344,14 @@ class AboutDialog:
artists_text = a_file.read()
artists = artists_text.split('\n')
dlg.set_artists(artists)
# connect close button to destroy() function
for button in dlg.action_area.get_children():
if button.get_property('label') == "_Close":
button.connect('clicked', lambda x:dlg.destroy())
dlg.connect('response', self.on_response)
dlg.show_all()
def on_response(self, dialog, response_id):
if response_id == Gtk.ResponseType.CANCEL:
dialog.destroy()
def tuple2str(self, tuple_):
str_ = ''
for num in tuple_: