I would like to know if there is a way to close Pane.
I want to use hide with some panes, but if a use the same name it gives an erro, that I knew it would happen. So I wanted to destroy then in a function so every time that I need to create another pane with the same name a call this function to close it frist.
Is it possible?
Kirix Support Forums
Closing Panes
6 posts
• Page 1 of 1
Re: Closing Panes
Should I use DetachPane?
- tncalucard
- Registered User
- Posts: 14
- Joined: Mon Oct 08, 2007 9:30 am
Re: Closing Panes
tncalucard wrote:Should I use DetachPane?
Yes. If you want to destroy your window, you should detach it from the manager by calling DetachPane first.
Best,
Ben
Ben Williams
Kirix Support Team
Kirix Support Team
-
Ben - Kirix Support Team
- Posts: 525
- Joined: Mon Dec 19, 2005 6:29 am
[SOLVED]Closing Panes
It's working, but I have to hide it before or I get an erro in the pane that will that it's place.
Wouldn't be faster if there was a close command like the close button, that hides it and destroy?
Is there something like it?
P.S: Sorry that it took time to reply I was out.
Wouldn't be faster if there was a close command like the close button, that hides it and destroy?
Is there something like it?
P.S: Sorry that it took time to reply I was out.
- tncalucard
- Registered User
- Posts: 14
- Joined: Mon Oct 08, 2007 9:30 am
Re: Closing Panes
Hello,
so what would be the best way to implement a quit button on a frame, which can be floating?
Detaching and destroying the pane works but is imo a bit complicated.
GetParent()->Close() would work right only when the frame is floating, but since the aui manager does not catch the event the parent window gets closed when the pane in docked.
So wouldn't it be possible for the manager to catch the close event and hide or destroy the frame? Or would this break something else?
so what would be the best way to implement a quit button on a frame, which can be floating?
Detaching and destroying the pane works but is imo a bit complicated.
GetParent()->Close() would work right only when the frame is floating, but since the aui manager does not catch the event the parent window gets closed when the pane in docked.
So wouldn't it be possible for the manager to catch the close event and hide or destroy the frame? Or would this break something else?
- MrNiceGuy
- Registered User
- Posts: 2
- Joined: Sun Nov 04, 2007 7:03 am
Re: Closing Panes
that's Way to destroy pane from event invoked from it (as another button or etc)
- Code: Select all
void MyFrame3::r333( wxCommandEvent& event ){
wxAuiPaneInfo &pane(m_mgr.GetPane(wxT("EPane1")));
if(pane.IsDestroyOnClose()){
wxAuiManagerEvent e(wxEVT_AUI_PANE_BUTTON);
e.SetButton(wxAUI_BUTTON_CLOSE);
e.SetManager(&m_mgr);
e.SetPane(&pane);
wxPostEvent(&m_mgr,e);
}else{
m_mgr.ClosePane(pane);
m_mgr.Update();
}
}
Let improove it together
- Jes
- Registered User
- Posts: 15
- Joined: Mon Oct 15, 2007 10:27 am
6 posts
· Page 1 of 1
Return to wxAUI Questions, Thoughts & Feedback