Upon clicking on it, it will disable itself and start a 1-second timer. When the timer is called, it will re-enable that same button.
This only works if I click the button, move the mouse pointer outside of the button and back, then the button will respond.
If I click the button, leave the mouse pointer where it is, wait for that 1-second timer period, I can see that the button is enabled. But if I click (without moving the mouse pointer outside), there's no response. How to fix this? (For now, I'd prefer avoid using the update window UI method.)
Any help is appreciated. Here's the code (runs on wx2.8 Hardy):
Code: Select all
EVT_TOOL(ID_GRAB, Frame::OnGrab)
EVT_TIMER(ID_TIMER, Frame::OnTimer)
void Frame::OnGrab(class wxCommandEvent&) {
toolbar_->EnableTool(ID_GRAB, false);
timer_.Start(1000);
}
void Frame::OnTimer(wxTimerEvent& event) {
timer_.Stop();
toolbar_->EnableTool(ID_GRAB, true);
}