From 6176e5c41f8ec09025bb82aad75a0f557172a55a Mon Sep 17 00:00:00 2001 From: Yann Leboulanger <asterix@lagaule.org> Date: Sun, 23 Mar 2014 16:24:59 +0100 Subject: [PATCH] better way to handle close button in about dialog --- src/dialogs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/dialogs.py b/src/dialogs.py index d540a0ead8..bec33f23f2 100644 --- a/src/dialogs.py +++ b/src/dialogs.py @@ -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_: -- GitLab