Keypad and GtkEntry


  I'm developing an application that at some point wants to accept some
input from the keyboard in a Gtkentry. When the user hits enter, the
focus should go to some other Gtkentry, so he can continue typing in it.
The program catches the activate signal and everything goes well, but
only if you hit the "usual" enter. If you hit the enter in the keypad,
it doesn't emit this activate signal. It it quite annoying for the user,
since the Gtkentries in this program are intended to receive numbers, so
the Keypad is the best place to type them.
    I have made a quick patch to gtkentry.c (against gtk 1.2.6), but
maybe this behaviour has some advantage, I would like to know it, if
this is the case. Or maybe I am missing something. Just forgive my
ignorance if I am mistaken.
    Anyway, here goes the patch:

--- gtkentry.c.old Wed Dec  1 00:04:09 1999
+++ gtkentry.c Tue Nov 30 23:30:23 1999
@@ -1114,6 +1114,7 @@
  gtk_move_forward_character (entry);
     case GDK_Return:
+    case GDK_KP_Enter:
       return_val = TRUE;
       gtk_widget_activate (widget);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]