On Sun, Dec 23, 2012 at 2:30 PM, Ville M. Vainio <[email protected]> wrote:
> I am having some problems wrapping my head around how focus behaves > throughout leo. > > IMO it would be a good idea to have only one place in Leo where focus is > explicitly set. E.g. g.setFocus(widget). This implementetation would > suffice: > > def setFocus(widget): > widget.setFocus() > > Reasoning: it would be handy to add debugging stuff here, to see why my > focus stuff is failing in alt-x go-anywhere handling. > > (My guess is treeFocusHelper only understanding focus being either in tree > or body, but no time to explore further now) > In fact, there is only one such place: c.outerUpdate. The various xWantsFocus methods simply set ivars, which c.outerUpdate uses to set the focus when a command completes. The various xWantsFocusNow methods call c.outerUpdate immediately. Usually we don't want to do this, because it could cause screen flash, but sometimes the immediate update is essential. I've marked this thread as a topic for implementers. Such things will form the basis for documentation for my successors. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/leo-editor?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
