From b13453ad9e9aa20b6fca064f8b185b0ea86e5aaf Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Fri, 30 May 2014 23:28:41 -0400 Subject: Changed storeSysData() on Windows to write the HWND to the sysData structure there. This will be important for removing some of the TODOs from areaWndProc(). --- sysdata_windows.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sysdata_windows.go') diff --git a/sysdata_windows.go b/sysdata_windows.go index 2a15ea8..fdfbd8c 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -179,7 +179,12 @@ func (s *sysData) make(window *sysData) (err error) { } return fmt.Errorf("error actually creating window/control: %v", r.err) } - s.hwnd = _HWND(r.ret) + if !ct.storeSysData { // regular control; store s.hwnd ourselves + s.hwnd = _HWND(r.ret) + } else if s.hwnd != _HWND(r.ret) { // we store sysData in storeSysData(); sanity check + // TODO really panic? + panic(fmt.Errorf("hwnd mismatch creating window/control: storeSysData() stored 0x%X but CreateWindowEx() returned 0x%X", s.hwnd, ret)) + } if !ct.doNotLoadFont { uitask <- &uimsg{ call: _sendMessage, -- cgit v1.2.3