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 » Mon Jul 11, 2011 3:01 pm

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 » Thu Jul 14, 2011 8:23 am

No idea or a hint? It's very important...

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax » Thu Jul 14, 2011 8:37 am

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 » Thu Jul 14, 2011 8:43 am

Oh... :oops:

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

Thank you! :roll:

User avatar
doublemax
Moderator
Moderator
Posts: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax » Thu Jul 14, 2011 8:46 am

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 » Thu Jul 14, 2011 8:50 am

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: 15065
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Closing a child frame - destructor

Post by doublemax » Thu Jul 14, 2011 8:54 am

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 » Thu Jul 14, 2011 8:59 am

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

Post Reply