[Urwid] [Fwd: Find focused Edit]

cantabile cantabile.03 at wanadoo.fr
Tue Jul 19 16:44:23 EDT 2005

Ian Ward a écrit :

> cantabile wrote:
> >Hi all,
> >
> >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.
> Ian
> _______________________________________________
> Urwid mailing list
> Urwid at lists.excess.org
> http://lists.excess.org/mailman/listinfo/urwid
Nice :)
I'll try that tomorrow and post the results here (no time tonight).

More information about the Urwid mailing list