On Thu, Mar 31, 2011 at 12:09 PM, Terry Brown <[email protected]> wrote:
> Was trying to squeeze in a little time to fix c.bringToFront(),
Please do *not* attempt to fix this. You have stumbled across one of
the most difficult areas of Leo.
> but ran into design issues wrt redraw machinery. I.e. c.bringToFront() just
> sets ivars which I assume are used by c.redraw().
Correct. The work actually happens in c.outerUpdate. c.redraw() also
just sets those ivars. BTW, c.redraw_now() calls c.redraw() and the
c.outer_update().
This design, while not being exactly intuitive, works extremely well
in almost all situations. In particular, it reduces actual drawing
operations to a minimum, thereby reducing flicker.
There is another advantage: the calls to the various focus-setting
methods, such as c.bodyWantsFocus, allow sophisticated tracing of
focus requests.
> I don't think c.bringToFront() brings the window to the front,
Correct. It simply sets c.requestedFocusWidget.
*Provided* that c.outerUpdate eventually gets called, the effect,
within c.outerUpdate will be to execute this code::
w = c.requestedFocusWidget
c.set_focus(w)
c.set_focus(w) calls g.app.gui.set_focus(w), the Qt version of which
calls w.setFocus(). You can trace all these routines.
*Important*: I suspect some Qt gui code is calling w.setFocus
directly, which could undermine this scheme. Another possibility is
that c.outerUpdate isn't being called because the call to
c.bringToFront is executing outside the logic of c.doCommand.
> and it certainly doesn't bring the correct tab to the front in the Qt tab
> interface.
This is a separate issue. Changing tabs changes commanders, so if
code uses the commander-oriented focus methods everything should just
work. That is, c.set_focus will work, but only if c matches the
selected tab.
> I think it needs to do both - the UNL machinery for inter-tree links calls
>it, but it doesn't work.
Again, this is a separate issue. In the qttabs gui, UNL must select
the proper commander/tab before issuing focus requests.
In short, there may be focus-related problems with the qttabs gui, but
messing with the low-level machinery is not likely to make things
better :-)
Edward
--
You received this message because you are subscribed to the Google Groups
"leo-editor" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/leo-editor?hl=en.