I dont understand well your concern, so far, the "focus-to-body,
focus-to-tree" etc commands work perfectly, plus if you want to focus on
the log you can do:
c.frame.log.selectTab('LogTabNameHere'), and you will focus your selected
log pane.


Also, when I was trying to identify where did the user click, I used
similar scripts to those for identifying the current focus:

if 'LeoQTreeWidget' in str(c.frame.getFocus():


if 'leoQtBody' in str(c.frame.getFocus():

If i remember correctly (which probably I dont, but this might be a clue),
if you call c.frame.getFocus() then get the childrens of its parent, you
can get the list of significant widgets.

Hope some of this is useful hehe.

On Mon, Nov 10, 2014 at 6:23 PM, 'Terry Brown' via leo-editor <
[email protected]> wrote:

> On Mon, 10 Nov 2014 05:15:34 -0800 (PST)
> "Edward K. Ream" <[email protected]> wrote:
>
> > The cycle-all-focus command is difficult to do properly because it
> > cycles through a list of widgets that changes as tabs are added to
> > the Log pane. It has been buggy from day one.
> >
> > An alternative would be to create a set of commands each of which
> > puts focus in a particular pane, for example, the spell tab, or the
> > tab created by the print-binding command.  That is, each command that
> > creates a log tab would create a corresponding "focus-to-x" command.
>
> I wonder if there's an easy way to do that by convention of widget
> names.  This code:
>
>
> names = {}
> def show_names(nd):
>
>     names.setdefault(str(nd.objectName()), set()).add(nd)
>     for nd in nd.children():
>         show_names(nd)
>
> show_names(c.frame.top)
> for name in sorted(names):
>     g.es("% 4d %s" % (len(names[name]), name))
> g.es(len(names))
>
> reports 207 widget names with their usage count.
>
> Maybe just something like
>
> g.add_focus_to_target(widget_name)
>
> which would create the corresponding Alt-X focus-to-* command.
>
> Also some sort of g.wrapper for
>
> c.frame.top.findChild("widget_name").setFocus(Qt.OtherFocusReason)
>
> Cheers -Terry
>
> > This is more appealing now that Leo supports alt-x history.  You
> > would just have to complete focus-to-<tab> once, and thereafter you
> > could use Alt-x up/down to pick the desired command.
> >
> > In short, I would like to replace cycle-all-focus with focus-to-x
> > commands.  I shall do nothing until I hear all your comments.
> >
> > 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.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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.
For more options, visit https://groups.google.com/d/optout.

Reply via email to