grab focus of popup so as to make keyboard flow easier
authorGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 31 Jan 2009 13:56:16 +0000 (14:56 +0100)
committerGuillaume Cottenceau <gcottenc@gmail.com>
Sat, 31 Jan 2009 13:56:16 +0000 (14:56 +0100)
bin/booh-classifier

index 75108db..04b4521 100755 (executable)
@@ -807,9 +807,11 @@ def show_popup(parent, msg, *options)
         dialog.vbox.add(options[:bottomwidget])
     end
     if options[:okcancel]
-        dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL)
+        dialog.add_button(Gtk::Stock::CANCEL, Gtk::Dialog::RESPONSE_CANCEL).grab_focus
+        dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK)
+    else
+        dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK).grab_focus
     end
-    dialog.add_button(Gtk::Stock::OK, Gtk::Dialog::RESPONSE_OK)
 
     if options[:pos_centered]
         dialog.window_position = Gtk::Window::POS_CENTER