Peter Damoc writes:
> Can you post your code please? I can't get it to work in
> 2.5.1.5/GTK2 at all.
Ooopsie... I'm on WinXP
it works overhere
so I guess it
might be a platform issue.
Yeah, the docs say it'll work for all managed windows, and on
Windows IIRC all windows are managed, whereas on GTK only
top-level (frames) windows are managed.
I *think* that a good way to know in advance if a given window
will react to Raise() or Lower() is whether or not a non-zero
value is returned from window.GetWindowHandle(). On Windows,
all windows have handles, where on Linux only top-level windows
do. I have no idea what happens on Mac.
That scores a point for Windows in the Windows/Linux debate,
IMHO. If I can't control the Zorder of my windows, I'm not in
complete control of the gui, and I'm a less effective
programmer because of it.
the code used to test it was something like
b1 = wx.Button(self, -1, "button1")
b2 = wx.Button(self, -1, "button2")
b2.SetPosition((20,-1))
b1.Raise()
and I got b1 on top of b2 
Confirmed. I just ran my test, which was similar to yours, on
Windows NT4/wxPython2.5.1.5 and Raise() worked, while on
GTK2/wxPython2.5.1.5 it didn't.
The Tab Order and Zorder limitations are going to bite me over
and over again... (but wx still rocks - I just have to learn
what workarounds to suggest to my users).
Now, one workaround for the Zorder problem seems to be to
recreate the siblings in the required order - I mentioned I was
going to try that on this list a week or so ago - but even that
is flaky and I've abandoned the exercise because:
+ Tab Order doesn't reflect the new Zorder, as Kevin Altis
warned previously.
+ Visible Zorder and which window on a stack of windows gets the
focus appear to be separate beasts, and are sometimes
consistent and sometimes not (a window that appears on top of
another may or may not be the one that gets the focus when
clicked upon - the focus *may* end up going instead to a
completely obscured window).
+ Some windows don't instantiate on top of the already existing
windows, but behind them, and some stay on top of
newly-instantiated controls. For example, check out my attached
code which instantiates a wxGauge, a wxButton, and a wxTextCtrl
on a wxPanel - the Gauge ends up on top of the button even
though it was instantiated first, and then the TextCtrl ends up
(correctly) on top of them all.
Conclusion: There are three problems that need to be addressed
in a multiplatform way: Zorder, SetFocus order, and Tab Order.
I know I don't have the knowledge, background, or coding ability
to make the required changes - indeed, I don't even know where
the required changes would go (wxWidgets, GTK, etc.) -, and
presumably if there were a straightforward solution it would
have already been done a long time ago. I am just a user, after
all, trying to find out how to use the tools available to
accomplish the task at hand.
layer.py (580 Bytes)
···
--
Paul