Hello,
Can anybody guide me on how to use the toggle button (wxToggleButton) for calling two different methods depending on the state of the button?
...
wxToggleButton* m_button_server;
...
EVT_TOGGLEBUTTON(wxID_BUTSERVER, NetClockFrame::OnServerStart)
EVT_TOGGLEBUTTON(wxID_BUTSERVER, NetClockFrame::OnServerStop)
...
m_button_server = new wxToggleButton(m_panel, wxID_BUTSERVER, _T("server [on/off]"), wxPoint(233, 30));
m_button_server->Bind(wxEVT_TOGGLEBUTTON, &NetClockFrame::OnServerStart, this);
m_button_server->Bind(wxEVT_TOGGLEBUTTON, &NetClockFrame::OnServerStop, this);
Regards,
MM
ToggleButton Topic is solved
Re: ToggleButton
You can't. But you can use event.GetInt() inside the event handler to get the state of the toggle button.
Use the source, Luke!