Closing a child frame - destructor Topic is solved

If you are using wxDev-C++ for your wxWidgets design, please ask your questions here instead of in IDE Related.
Post Reply
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Closing a child frame - destructor

Post by eriX »

Hello,

I have some little trouble with my childframes.

My main Window is called "StartFrm".

I call the childframe "ansehen" with the following code:

Code: Select all

ansehen *childframe = new ansehen(this); 
childframe->Show(); 
Show(false);
My main window is now hidden and "ansehen" appeared.

Now I want to show my "StartFrm" again and destroy the childframe "ansehen" completely.

How can I do this?

- Eric.
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Re: Closing a child frame - destructor

Post by eriX »

No idea or a hint? It's very important...
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax »

Code: Select all

childframe->Destroy();
Show(true);
?
Use the source, Luke!
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Re: Closing a child frame - destructor

Post by eriX »

Oh... :oops:

I've tested ->Destroy(); without Show(true);
Then my complete program was destroyed.

Thank you! :roll:
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax »

Please show some more code in context.
Use the source, Luke!
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Re: Closing a child frame - destructor

Post by eriX »

childframe->Destroy();
Show(true);

Had worked as I said...


But how do I "parentframe->Show(true);" from the childframe without to create it again?
User avatar
doublemax
Moderator
Moderator
Posts: 19115
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax »

From inside the childframe, try:

Code: Select all

GetParent()->Show();
Use the source, Luke!
eriX
Experienced Solver
Experienced Solver
Posts: 84
Joined: Wed Feb 04, 2009 2:08 pm
Location: Germany
Contact:

Re: Closing a child frame - destructor

Post by eriX »

Thank you very much.
Now everything is working well ;)
Post Reply