| 394 | } |
| 395 | |
| 396 | void TrackPanel::OnIdle(wxIdleEvent& event) |
| 397 | { |
| 398 | event.Skip(); |
| 399 | // The window must be ready when the timer fires (#1401) |
| 400 | if (IsShownOnScreen()) |
| 401 | { |
| 402 | mTimer.Start(std::chrono::milliseconds{kTimerInterval}.count(), FALSE); |
| 403 | |
| 404 | // Timer is started, we don't need the event anymore |
| 405 | GetProjectFrame( *GetProject() ).Unbind(wxEVT_IDLE, |
| 406 | &TrackPanel::OnIdle, this); |
| 407 | } |
| 408 | else |
| 409 | { |
| 410 | // Get another idle event, wx only guarantees we get one |
| 411 | // event after "some other normal events occur" |
| 412 | event.RequestMore(); |
| 413 | } |
| 414 | } |
| 415 | |
| 416 | /// AS: This gets called on our wx timer events. |
| 417 | void TrackPanel::OnTimer(wxTimerEvent& ) |