()
| 13 | ) |
| 14 | |
| 15 | func (fb *FormBase) mainLoop() int { |
| 16 | msg := (*win.MSG)(unsafe.Pointer(win.GlobalAlloc(0, unsafe.Sizeof(win.MSG{})))) |
| 17 | defer win.GlobalFree(win.HGLOBAL(unsafe.Pointer(msg))) |
| 18 | |
| 19 | for fb.hWnd != 0 { |
| 20 | switch win.GetMessage(msg, 0, 0, 0) { |
| 21 | case 0: |
| 22 | return int(msg.WParam) |
| 23 | |
| 24 | case -1: |
| 25 | return -1 |
| 26 | } |
| 27 | |
| 28 | switch msg.Message { |
| 29 | case win.WM_KEYDOWN: |
| 30 | if fb.handleKeyDown(msg) { |
| 31 | continue |
| 32 | } |
| 33 | } |
| 34 | |
| 35 | if !win.IsDialogMessage(fb.hWnd, msg) { |
| 36 | win.TranslateMessage(msg) |
| 37 | win.DispatchMessage(msg) |
| 38 | } |
| 39 | |
| 40 | fb.group.RunSynchronized() |
| 41 | } |
| 42 | |
| 43 | return 0 |
| 44 | } |
nothing calls this directly
no test coverage detected