wxwidgets中的togglebutton->getValue在运行时出现访问冲突错误?
fxButtonYesNo = new wxToggleButton( this, wxID_ANY, wxT("OFF") );
fxButtonYesNo->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,
wxCommandEventHandler(fxButtonYesNoState) );
void fxButtonYesNoState( wxCommandEvent& event )
{ bool fxPressedValue = fxButtonYesNo->GetValue();
if(fxPressedValue)
{ fxTextPre->SetLabel("FX ON "); }
else { fxTextPre->SetLabel("FX OFF "); } }>
发布于 2012-03-20 17:44:51
好了,错误被发现了!togglebutton的Connect函数未完成,因此出现访问冲突错误!完整的Connect函数为:
fxButtonYesNo->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED,wxCommandEventHandler(fxButtonYesNoState),nulltpr,this );
https://stackoverflow.com/questions/9769359
复制相似问题