MCPcopy Create free account
hub / github.com/lxn/walk / mainLoop

Method mainLoop

mainloop_default.go:15–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13)
14
15func (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}

Callers

nothing calls this directly

Calls 2

handleKeyDownMethod · 0.95
RunSynchronizedMethod · 0.80

Tested by

no test coverage detected