eventLoop runs the event processing loop for the RenderWindow -- grabs system events for the window and dispatches them to receiving nodes, and manages other state etc (popups, etc).
()
| 390 | // events for the window and dispatches them to receiving nodes, and manages |
| 391 | // other state etc (popups, etc). |
| 392 | func (w *renderWindow) eventLoop() { |
| 393 | defer func() { system.HandleRecover(recover()) }() |
| 394 | |
| 395 | d := &w.SystemWindow.Events().Deque |
| 396 | |
| 397 | for { |
| 398 | if w.stopEventLoop { |
| 399 | w.stopEventLoop = false |
| 400 | break |
| 401 | } |
| 402 | e := d.NextEvent() |
| 403 | if w.stopEventLoop { |
| 404 | w.stopEventLoop = false |
| 405 | break |
| 406 | } |
| 407 | w.handleEvent(e) |
| 408 | if w.noEventsChan != nil && len(d.Back) == 0 && len(d.Front) == 0 { |
| 409 | w.noEventsChan <- struct{}{} |
| 410 | } |
| 411 | } |
| 412 | if DebugSettings.WinEventTrace { |
| 413 | fmt.Printf("Win: %v out of event loop\n", w.name) |
| 414 | } |
| 415 | windowWait.Done() |
| 416 | // our last act must be self destruction! |
| 417 | w.mains.deleteAll() |
| 418 | } |
| 419 | |
| 420 | // handleEvent processes given events.Event. |
| 421 | // All event processing operates under a RenderContext.Lock |
no test coverage detected