user2753594
user2753594

Reputation: 145

wxMiniFrame always shows on top

I created a GUI in the wxFrame which is the main window. In the main window class, I have members which are a wxMiniFrame, and a wxPanel.

On the wxPanel there is a button, when I click the button a new wxMiniFrame will create and show, the parent of the wxMiniFrame is the wxFrame. When the mini frame is created, it always shows on the top. Even though I clicked on the main window, the mini frame is shown on the top.

However, if I change the wxMiniFrame' parent to the panel, the mini frame can work properly. It will go to the back when I click the main window.

Could anyone explain why this happen? Thank you.

Upvotes: 1

Views: 239

Answers (1)

VZ.
VZ.

Reputation: 22753

wxMiniFrame uses wxFRAME_FLOAT_ON_PARENT style when created with a non-NULL parent which is appropriate for palette-like windows, that mini frames are supposed to be used for. If you don't want it, you could create a regular wxFrame with wxFRAME_TOOL_WINDOW style.

Upvotes: 2

Related Questions