Re: Automatic focus handling? How do I turn it off?



>I apologize if I wasn't clear in my email.  The problem is that pressing
>keys such as the arrow keys, the backspace, and the tab cause my widget to
>lose focus and for its containing window to gain focus. The key press
>event first hits my widget and then, once I have returned 0 from the
>key_press handler, control returns to gtk, the focus is removed, and the
>event is propagated to the containing window where it is handled.
>
>So I suppose it could have something to do with gtk's support for moving
>the focus with tab, etc.. How does one turn this functionality off?

you can't turn it off per se. you have two choices:

1) on a per-widget basis, catch key_press/key release events. if they
   are for one of the navigation keys, do nothing except:

   gtk_signal_emit_block_by_name (...);
   return TRUE;

2) install a global key snooper, inspect all key press events, and
   discard or translate the navigation keys.

and yes, i don't like it any more than you do :)

--p




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