From ebbd76716f3e35bdb86a6ca9b327bc014d7f6e3b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Thu, 26 Jun 2014 21:40:23 -0400 Subject: [PATCH] Implemented Checkbox.SetChecked() on Windows. --- sysdata_windows.go | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/sysdata_windows.go b/sysdata_windows.go index f3ecffe..504b715 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -635,3 +635,21 @@ func (s *sysData) center() { } <-ret } + +func (s *sysData) setChecked(checked bool) { + ret := make(chan struct{}) + defer close(ret) + uitask <- func() { + c := uintptr(_BST_CHECKED) + if !checked { + c = uintptr(_BST_UNCHECKED) + } + _sendMessage.Call( + uintptr(s.hwnd), + uintptr(_BM_SETCHECK), + c, + uintptr(0)) + ret <- struct{}{} + } + <-ret +}