[Urwid] [Fwd: Find focused Edit]
ian at excess.org
Tue Jul 19 15:26:20 EDT 2005
>I'm trying end write a urwid based gui for server tools install.
>I have several Edit's piled (with Pile() of course) in Columns.
>Now, I'd like to display some help for each Edit in the frame footer.
>I'm aware that get_focus() exists, but in that case, it gives back a
>Column instead of the Edit.
>How could I do to get the highlighted / focused Edit to display its
>help, or the app. to retrieve the highlighted Edit when it changes ?
>Thanks for your help.
Columns and Pile objects also have get_focus() methods that you can use
to drill down to the Edit widget. To make your code generic with
respect to the containing Columns and Pile widgets you could use a
"while hasattr( w, 'get_focus' ): w = w.get_focus()" loop to drill down.
More information about the Urwid