I've created a program with several checkboxes and they work fine. My problem is when I try to get or set the state of the checkbox manually. Can you point me to some sample code using these functions( Get or SetValue())?
It crashes every time I try to use GetValue or SetValue. Otherwise the checkboxes work fine.:
checkbox12->GetValue()
checkbox12->SetValue(false)
header file:
private:
void OnCHECKBOX12Event(wxCommandEvent& evt);
wxCheckBox* checkbox12;
main CPP file
#include <wx/checkbox.h>
wxCheckBox* checkbox12 = new wxCheckBox(panel1, wxID_CHECKBOX12, "", wxPoint(360, 388), wxDefaultSize, 0);
void WxButton1Frame::OnButton19Clicked(wxCommandEvent& evt) {
//A bunch of other code
if (checkbox12->GetValue() == true) {
checkbox12->SetValue(false);
}
}
void WxButton1Frame::OnCHECKBOX12Event(wxCommandEvent& evt)
{
if (evt.IsChecked()) {
} else {
}
}
wxBEGIN_EVENT_TABLE(WxButton1Frame, wxFrame)
EVT_CHECKBOX(wxID_CHECKBOX12, WxButton1Frame::OnCHECKBOX12Event)
wxEND_EVENT_TABLE()