olekb
olekb

Reputation: 648

How do I keep wx.Frame on top not only it's parent frame but all other child frames parent opens?

I can keep a frame on top of a parent using style:

wx.FRAME_FLOAT_ON_PARENT

But it loses focus if this parent opens other child windows.

Is there a way to keep it on top of all windows of this given application? I cannot use wx.STAY_ON_TOP because when I Alt-Tab to other process it's always on top.

Upvotes: 1

Views: 611

Answers (1)

user2682863
user2682863

Reputation: 3217

The easiest solutions (without seeing the code) would probably be to

1. Bind the frame to EVT_KILL_FOCUS and then call frame.SetFocus() from the bound event. The downside is that having multiple widgets on that frame can complicate things as you would have to bind to each widget. To get the frame that has the focus call wx.GetActiveWindow().

2. Bind the other windows to EVT_ACTIVATE and then call frame.SetFocus() to re-activate the correct frame.

3. Try to call frame.ShowWithoutActivating on the other frames that you are showing to prevent them from receiving the focus.

4. Some combination of the above

Upvotes: 1

Related Questions