Re: [pygtk] Focus navigation in GTK 1.2



On Sun, 2 Sep 2001, Christian Robottom Reis wrote:


Hi,

I've been wondering about how focus navigation is controlled in GTK. I now
understand that each widget can be configured focusable or not - labels,
for instance, are not by default - and that we cycle focus more or less
sequentially on tab (and shift-tab back). However, I still wonder about
this point:

Is there a "focus position" or "order" by which one could specify which
widget comes after which when tabbing? Or does GTK calculate this
automatically and we accept what we get? It seems strange, because this
reduces accessibility somewhat, and makes larger interfaces hard on
mouseless users.

Each container implements a virtual function to handle focus cycling.  For
tabbing, it is basically a depth first tree walk, descending into child
widgets, the container deciding what order the children should be
traversed.

For 2.0, it is possible to override the child ordering for a particular
container, and individual widgets can implement focus cycling if they
contain multiple focusable elements (think of a canvas widget for
instance).

Gtk also allows you to change focus with the arrow keys (provided the
currently focused widget doesn't use those keys itself).  This can provide
easier focus switching than other toolkits (except when focus gets
`stuck').

James.

-- 
Email: james daa com au
WWW:   http://www.daa.com.au/~james/






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