diff options
| author | Pietro Gagliardi <[email protected]> | 2014-02-12 11:32:17 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-02-12 11:32:17 -0500 |
| commit | 5f587fbf479f91bdf5d825a11c3806084b067317 (patch) | |
| tree | aa602d8992977b4da5779f949e39be14e68f8309 | |
| parent | ddfb5c760345b03c16c1559bd3e83cbafb8b11c3 (diff) | |
Added button events.
| -rw-r--r-- | stdwndclass_windows.go | 11 | ||||
| -rw-r--r-- | sysdata.go | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index fae357a..e4974d1 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -22,9 +22,14 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL } switch uMsg { case _WM_COMMAND: - id := wParam.LOWORD() - // ... member events - _ = id + id := _HMENU(wParam.LOWORD()) + sysData = getSysDataID(id) + switch sysData.ctype { + case c_button: + if wParam.HIWORD() == _BN_CLICKED { + sysData.clicked <- struct{}{} + } + } return 0 case _WM_GETMINMAXINFO: mm := lParam.MINMAXINFO() @@ -12,6 +12,9 @@ type cSysData struct { // for Window closing chan struct{} + + // for Button + clicked chan struct{} } func (c *cSysData) make(initText string, initWidth int, initHeight int) error { panic(runtime.GOOS + " sysData does not define make()") |
