[Urwid][Fwd: Find focused Edit]

ian at excess.org ian at excess.org
Sat Jul 30 13:34:07 EDT 2005


On Sat, Jul 30, 2005 at 06:03:21PM +0200, cantabile wrote:
>            while not keys:
>                keys= self.ui.get_input()
>                for k in keys:
>                    if k == 'window resize':
>                        size = self.ui.get_cols_rows()
>                    elif k == 'f5':
>                            self.update(self.makeDict())
>                            return
>                    elif k== 'f8':
>                        return
>                    else:
>                        w, pos = self.listbox.get_focus()
>                        while hasattr(w, 'get_focus'):
>                            w = w.get_focus()
>                            if w.__class__.__name__ == 'It':
>                                HELP.settext(w.gethelp())
>            self.view.keypress(size, k)


Try this instead:

            while not keys:
                keys= self.ui.get_input()
                for k in keys:
                    if k == 'window resize':
                        size = self.ui.get_cols_rows()
                    elif k == 'f5':
                            self.update(self.makeDict())
                            return
                    elif k== 'f8':
                        return
                    else:
                        self.view.keypress(size, k)
	
            w, pos = self.listbox.get_focus()
            while hasattr(w, 'get_focus'):
                w = w.get_focus()
                if w.__class__.__name__ == 'It':
                    HELP.settext(w.gethelp())





More information about the Urwid mailing list