<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39912 >

First, I tried an obvious addition to the menu system with the shortcut key.
No joy.  The "\'" itself doesn't show in the menu, and it doesn't work.

Next, I tried reading the on-line manual.  And discovered that the entire
menu system here was deprecated in GTK+ 2.4.  Not just replaced, which was
apparently done as an early component of GTK2, but deprecated!

Yet, we already require >= 2.4 to configure!  <Hair being torn out>

Then, I discovered that some flower of his mother's life used the
gtk_label_new_with_mnemonic() to put the underscore in "_Chat", but
forgot to use gtk_label_set_mnemonic_widget() to activate the shortcut.

Also, the same problem with "_Map".  These widget shortcuts don't work at
all!  You have to use the mouse to activate the widgets.  (I'd thought it
was some problem with MacOS, but apparently it's never worked for anybody.)

I've figured out how to bypass the problems by intercepting keystrokes in
client/gui-gtk-2.0/gui_main.c keyboard_handler(), but it's not ideal....

Index: client/gui-gtk-2.0/gui_main.c
===================================================================
--- client/gui-gtk-2.0/gui_main.c       (revision 14093)
+++ client/gui-gtk-2.0/gui_main.c       (working copy)
@@ -457,7 +457,6 @@
     return FALSE;
   }
 
-
   if ((ev->state & GDK_SHIFT_MASK)) {
     switch (ev->keyval) {
     case GDK_Left:
@@ -498,7 +497,19 @@
     default:
       break;
     }
+  } else {
+    switch (ev->keyval) {
+
+    case GDK_apostrophe:
+      gtk_notebook_set_current_page(GTK_NOTEBOOK(bottom_notebook), 0);
+      gtk_widget_grab_focus(inputline);
+      return TRUE;
+
+    default:
+      break;
+    };
   }
+
   /* Return here if observer */
   if (client_is_observer()) {
     return FALSE;
@@ -1243,7 +1254,7 @@
   gtk_widget_set_size_request(sw, 600, 100);
   gtk_box_pack_start(GTK_BOX(vbox), sw, TRUE, TRUE, 0);
 
-  label = gtk_label_new_with_mnemonic(_("_Chat"));
+  label = gtk_label_new(_("Chat"));
   gtk_notebook_append_page(GTK_NOTEBOOK(bottom_notebook), vbox, label);
 
   text = gtk_text_view_new_with_buffer(message_buffer);
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to