[Glade-users] Disabling menu accelerators for certain widgets?

I have a menu accelerator tied to space. There is a search box in the
application. When I enter text in the search box I want to disable the
space accelerator to make it possible to enter spaces in the search
text. Is this possible?

I've tried to catch key_press_events for the search box and return TRUE,
but it does not work:

on_searchentry_key_press_event         (GtkWidget       *widget,
                                         GdkEventKey     *event,
                                         gpointer         user_data)
         print_status("Key pressed");
         if (event->keyval == GDK_space) {
           /* Accelerator will still kick in here... */
                 return TRUE;
         if (event->keyval == GDK_Tab) {
           /* This disables GTK's handling of Tab */
                 return TRUE;
         return FALSE;

I was hoping there was an easy option in glade to say that accelerators 
should not be applied to certain widgets, but haven't found it yet. Any 
ideas on what to do?


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