[chirp_devel] [PATCH] GTK+ 2.0 can't grab button focus, handle gracefully. Fixes #1219
# HG changeset patch # User Tom Hayward tom@tomh.us # Date 1383678660 28800 # Node ID d57bc05a9dd64c57e3246e74d12fe04bcf640526 # Parent b989118832cb7d4a7586f026f9f205313234ea69 GTK+ 2.0 can't grab button focus, handle gracefully. Fixes #1219
diff -r b989118832cb -r d57bc05a9dd6 chirpui/mainapp.py --- a/chirpui/mainapp.py Thu Oct 10 17:17:20 2013 -0700 +++ b/chirpui/mainapp.py Tue Nov 05 11:11:00 2013 -0800 @@ -591,10 +591,14 @@ again = gtk.CheckButton(_("Don't show instructions for any radio again")) again.show() d.vbox.pack_start(again, 0, 0, 0) - h_button_box=d.vbox.get_children()[2] - ok_button=h_button_box.get_children()[0] - ok_button.grab_default() - ok_button.grab_focus() + h_button_box = d.vbox.get_children()[2] + try: + ok_button = h_button_box.get_children()[0] + ok_button.grab_default() + ok_button.grab_focus() + except AttributeError: + # don't grab focus on GTK+ 2.0 + pass d.run() d.destroy() CONF.set_bool("clone_instructions", again.get_active(), "noconfirm")
participants (1)
-
Tom Hayward