Page 1 of 1

Problems with showing two wxFrame objects

Posted: Tue Mar 10, 2009 9:56 am
by xargon
Hello,

I have a problem where I cannot show two wxFrame objects together. The second one only shows after the first one is minimized or closed.

So, if I have code as follows...

wxFrame * frame1 = new wxFrame(NULL, ....) // constructor
frame1->Center();
frame1->Show();

MyWorkerThread * thread = new MyWorkerThread();
thread->Create();
thread->Run();

wxFrame * frame2 = new wxFrame(NULL, ....) // constructor
frame2->Center();
frame2->Show();

frame2 only shows after frame1 has been minimized or closed. How can I show them together? I notice this only happens when I have a thread running...

Cheers,
Luca

Posted: Tue Mar 10, 2009 10:10 am
by Muetdhiver
Maybe by making the second to depend on the first ?

This work ? :

Code: Select all

wxFrame * frame2 = new wxFrame(frame1, ....)

Bye

Posted: Tue Mar 10, 2009 10:18 am
by lester
Or maybe wxTheApp->SetTopWindow( frame1 ); ?