diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-05 18:28:40 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-05 18:28:40 -0400 |
| commit | bb44712fad85ad7262ab6b82b3056753e4f1f20e (patch) | |
| tree | eeb508b0e252a1c30fbe2d6114e97e0270e55375 /stdwndclass_windows.go | |
| parent | 753f4316e23239c62d510240372d9a8cbba5e0f0 (diff) | |
Changed Checkbox on Windows to use BS_CHECKBOX instead of BS_AUTOCHECKBOX; this will be necessary to fix the focus issue in todo.md (see http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx).
Diffstat (limited to 'stdwndclass_windows.go')
| -rw-r--r-- | stdwndclass_windows.go | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go index f4004e4..7ec25fb 100644 --- a/stdwndclass_windows.go +++ b/stdwndclass_windows.go @@ -84,6 +84,25 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL if wParam.HIWORD() == _BN_CLICKED { ss.signal() } + case c_checkbox: + // we opt into doing this ourselves because http://blogs.msdn.com/b/oldnewthing/archive/2014/05/22/10527522.aspx + if wParam.HIWORD() == _BN_CLICKED { + state, _, _ := _sendMessage.Call( + uintptr(ss.hwnd), + uintptr(_BM_GETCHECK), + uintptr(0), + uintptr(0)) + if state == _BST_CHECKED { + state = _BST_UNCHECKED + } else if state == _BST_UNCHECKED { + state = _BST_CHECKED + } + _sendMessage.Call( + uintptr(ss.hwnd), + uintptr(_BM_SETCHECK), + state, // already uintptr + uintptr(0)) + } } return 0 case _WM_GETMINMAXINFO: |
