Re: key snoopers



> the key observation here is that most of the widgets should never have
> focus to begin with. short of using unset_flags(GTK_CAN_FOCUS) there's
> no way to enforce this simply. so navigation between those many
> widgets is just a nonissue. mouse clicks on them do something, but
> they don't move focus around.
[ snip ]
> going on. Once again, using the mouse for this is no good, because a
> mouse click on a transport control button has a different meaning, and
> may not be intended to transfer keyboard focus at all. This, of
> course, is the general problem with the focus model in GTK: if you
> click on a widget, it tends to be assumed that it has focus, and you
> have to do several things to avoid it. Its much easier for me to start
> with there being no default focus-follows-click anywhere and then add
> it as its needed.


i'll second this. my general solution is to tell unset focus for all widgets
and handle key presses with a key_event_handler at the toplevel, which
mostly works. maybe next time i will try the key_snooper instead.

my feeling is that the gtk focus model is great for quickly throwing
together something that sort of works (if you try, you can usually
convince the focus to go where you want it) but that it is extremely
difficult to make it work smoothly and intuitively.

seth





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