Page 1 of 1

Program doesn't exit when XRC LoadFrame is used

Posted: Tue Feb 14, 2006 5:05 pm
by jsheets
Hello Everyone,

I'm experiencing some difficulty in using XRC, I'm using XRC to define a very basic frame and then use LoadFrame within the constructor of the frame.

The frame displays properly but unfortunately after the user closes the frame the program remains running even though there are no active frames and the main frame has been closed.

The program functions as expected when XRC is not used.

Any insight is appreciated.


wxWidgets 2.6.2 both static and DLL compliation

XRC File:

Code: Select all

MainFrame::MainFrame(wxWindow* parent, int id, const wxString& title, const wxPoint& pos, const wxSize& size, long style):
    wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE)

    // normally done OnInit but placed here for simplicity


    wxXmlResource::Get()->LoadFrame(this, GetParent(), "MainFrame");

Posted: Tue Feb 14, 2006 5:49 pm
by DavidHart

You're loading the frame twice. Once with the line : wxFrame(parent, id, title, pos, size, wxDEFAULT_FRAME_STYLE) and then again with xrc.
Just do it the second way.