On Thu, Mar 31, 2011 at 8:59 PM, Terry Brown <[email protected]> wrote:

> So is c.bringToFront() intended to raise the window containing c, or
> not?  It doesn't, in both tabbed and non-tabbed qt.

Yes.  That is the intention.  c.bringToFront() sets::

    c.requestedIconify = 'deiconify'

which will cause c.outerUpdate to call c.frame.deiconify().  The qt
version of deiconify is in qtGui.py:

Qt gui-->@file qtGui.py-->Frame and component classes...-->class
leoQtFrame-->Qt bindings... (qtFrame)

def deiconify (self):
    if self.top.isMinimized(): # Bug fix: 400739.
        self.lift()

The conclusion is that c.bringToFront() will wok *provided* c is
correct *and* c.update() will be called.

c.outerUpdate will be called automatically whenever c.inCommand is
True, except when the code has requested that the window be killed
after the execution of a command.  See the code at the end of
c.doCommand.

Code that is not in the range of a command may call c.outerUpdate().
Looking through the code for various plugins, including qtGui.py, I
see that it is fairly common to call c.outerUpdate from callbacks.
But please only do this if you are sure it is necessary.  Otherwise
the purpose of queuing requests will be defeated.

In short, if c.bringToFront() doesn't seem to work, try calling c.outerUpdate().

Edward

P.S. Before anyone claims that c.outerUpdate seems unnecessary, let me
say that it performs an important role, regardless of whether the
underlying gui does a good job of eliminating needless redraws.
Methods like c.bodyWantsFocus declare that at the *end* of the
processing for a command that the body pane shall get focus,
*regardless* of what (low-level) focus requests may have been made
before the call, or are *going* to be made after the call.
Furthermore, there are times, especially in the Find/Replace logic,
where c.bodyWantsFocusNow must be called to transfer focus
immediately.  c.outerUpdate handles, in a unified way, many logically
difficult problems.

P.P.S. I have said many times that the process of switching commanders
(with or without tabs) is inherently complex. I don't know the details
of what Terry is trying to do, but switching tabs for this reason.

EKR

-- 
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.

Reply via email to