[pygtk] Focus Headache

Johan Dahlin jdahlin at async.com.br
Mon Aug 7 21:40:05 WST 2006


Adriano Monteiro wrote:
> Johan,
> 
>> set_focus_chain works on a per container basis, you can't just call it
>> once
>> for the toplevel, you might need to call it for each container in your
>> interface, in your case the window and the boxes.
> 
> Is that the only way? Because by doing this, I'll have to define the
> focus chain for the entire interface (that is not only this window).
> The code I sent, is part of the Umit interface, so it's going to be
> quite boring to define the focus chain for the entire interface.

As far as I know it's the only way to change the order of the focus.
You might not need to define the /whole/ focus chain, because normally the
GtkContainer does a pretty good job of focusing the right widgets.

> If this is the only way, can you give an example of how doing so with
> the code I gave (by setting teh focus chain for the window, top box,
> and toolbars)? I looked at the pygtk faq, and found a thread about
> this, but I think it's not clear for me, and I didn't get how to
> handle set_focus_chain.

There are a couple of examples in Stoq:

http://svn.async.com.br/cgi-bin/viewcvs.cgi/stoq/trunk/stoq/gui/pos/pos.py?rev=4068&view=markup

-- 
Johan Dahlin <jdahlin at async.com.br>
Async Open Source


More information about the pygtk mailing list