R
rory
Hi everyone. I am developing a program using wxWidgets, but my problems
are more to do with general C++ practices so I've decided to ask here
rather than on the wxWidgets list. I have a main class, my frame class,
which contains lots of GUI controls I need in my application. I've also
derived a new class, wxLoopStation, from the MDIChildFrame base class.
I create an objects of this class in one of my main frame class member
functions and it all goes fine. The problem is when I try to access a
member variable of wxLoopStation I keep getting a crash, the program
simply hangs there? Any ideas? Here is some pseudo code from my app:
//wxLooperFrame is my main class....
void wxLooperFrame::CreateChildFrame()
{
//create a new child frame...
loopStation=new wxLoopStation((wxMDIParentFrame*)this, -1, "Loop1",
wxPoint(20, 20), wxSize(215, 255));
//create a text box in new child frame
loopStation->freqText = new wxTextCtrl(panel, -1, "1",wxPoint(140,
24), wxSize(40, 20), wxTE_READONLY);
}
void wxLooperFrame::ButtonClick()
{
//read text from loopStation's text control
wxMessageBox(loopStation->freqText->GetLabel());
}
So whenever ButtonClick() is called I get a crash. Any ideas? I hope
it's something simple!
Rory.
are more to do with general C++ practices so I've decided to ask here
rather than on the wxWidgets list. I have a main class, my frame class,
which contains lots of GUI controls I need in my application. I've also
derived a new class, wxLoopStation, from the MDIChildFrame base class.
I create an objects of this class in one of my main frame class member
functions and it all goes fine. The problem is when I try to access a
member variable of wxLoopStation I keep getting a crash, the program
simply hangs there? Any ideas? Here is some pseudo code from my app:
//wxLooperFrame is my main class....
void wxLooperFrame::CreateChildFrame()
{
//create a new child frame...
loopStation=new wxLoopStation((wxMDIParentFrame*)this, -1, "Loop1",
wxPoint(20, 20), wxSize(215, 255));
//create a text box in new child frame
loopStation->freqText = new wxTextCtrl(panel, -1, "1",wxPoint(140,
24), wxSize(40, 20), wxTE_READONLY);
}
void wxLooperFrame::ButtonClick()
{
//read text from loopStation's text control
wxMessageBox(loopStation->freqText->GetLabel());
}
So whenever ButtonClick() is called I get a crash. Any ideas? I hope
it's something simple!
Rory.