Kirix Support Forums

How to hide/show a docked or floating panel

Please post all general questions, comments, bug reports, and any other wxAUI feedback here.

How to hide/show a docked or floating panel

Postby sk on Mon Jul 17, 2006 5:55 pm

I've ported my app from an MDI application to one using wxAUI, but have not figure out how to solve the following problem.

Originially, I had a set of wxFrames which could be opened from a menu selection, and closed with the X checkbox on each frame. Instead of closing and deleting the frame, the OnClose handler would just call Show(false) and veto the event. Events could still be sent to the window while hidden, and its state would persist between uses. When the user made a menu selection to view the frame, the original frame would be shown again.

If I try this in wxAUI, the app will crash. How can this be implemented with wxAUI?
sk
Registered User
 
Posts: 2
Joined: Mon Jul 17, 2006 5:49 pm

Re: How to hide/show a docked or floating panel

Postby Ben on Tue Jul 18, 2006 6:26 am

sk wrote:I've ported my app from an MDI application to one using wxAUI, but have not figure out how to solve the following problem.

Originially, I had a set of wxFrames which could be opened from a menu selection, and closed with the X checkbox on each frame. Instead of closing and deleting the frame, the OnClose handler would just call Show(false) and veto the event. Events could still be sent to the window while hidden, and its state would persist between uses. When the user made a menu selection to view the frame, the original frame would be shown again.

If I try this in wxAUI, the app will crash. How can this be implemented with wxAUI?


In order to solve your crash, I might need a bit of sample code. However, what you want to do is probably already feasible in wxAUI. wxAUI doesn't destroy the window when the user presses the X, either. When close is clicked, it takes the content window, i.e. the window that shows the information inside the floating pane, hides it, then reparents that window to the main frame.

The window pointer doesn't actually disappear, so the window should still be able to receive events.

As for what is actually causing the crash, I won't know until I can examine some sample code. If you post some, I'll be more than happy to take a look.

Best
Ben
User avatar
Ben
Kirix Support Team
 
Posts: 522
Joined: Mon Dec 19, 2005 6:29 am

Postby sk on Tue Jul 18, 2006 2:53 pm

Never mind, I figured it out right after I posted the message. I had thought that wxAUI would destroy the floating pane instead of hide it. When the user tried to reopen the window again, I would call AddPane a second time, which would cause wxAUI to behave weirdly for a bit and then crash.

Instead of calling AddPane, I just used GetPane(wxWindow*).Show(), which works.

Thanks,
sk
Registered User
 
Posts: 2
Joined: Mon Jul 17, 2006 5:49 pm

Return to wxAUI Questions, Thoughts & Feedback