I’m using STAY_ON_TOP in the style when I create my Frame app so it is
always on top, and it works fine. What I want, though, is for the Frame
to
stay on top under some conditions, but behave normally under other
conditions. I don’t see any set_style method for Frame that would let
me
turn the STAY_ON_TOP behavior on and off dynamically. Is there any way
to
do this?
I’m using STAY_ON_TOP in the style when I create my Frame app so it is
always on top, and it works fine. What I want, though, is for the
Frame to stay on top under some conditions, but behave normally under
other conditions. I don’t see any set_style method for Frame that
would let me turn the STAY_ON_TOP behavior on and off dynamically. Is
there any way to do this?
From my reading of wxWidgets discussions, there’s no way to change the
style flags of a Window (inc Frame) after it’s been created. This is
because changes are not guaranteed to be honoured on all platforms.
The way round this in your circumstance might be to have two frames,
with one hidden and one shown at any time. One has the STAY_ON_TOP
style, the other not. When you want to change the STAY_ON_TOP behaviour:
hide the currently shown frame
reparent that frame’s top-level content (eg Panel) to the other frame
move the frame you’re about to show to the same size and position
Thanks, but I just noticed that there is a Window#set_window_style_flag
which seems like it would do what I want. I think I’ll give that a try.
If
it doesn’t work I might try your two frames solution.