diff options
| author | Pietro Gagliardi <[email protected]> | 2014-05-30 22:14:55 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-05-30 22:14:55 -0400 |
| commit | 855a09656a382d4089674712b400391a6e9dd3f9 (patch) | |
| tree | 5af7737d8cb3931db2ade3250f5ec7fba0dbe65c | |
| parent | a3e27bfbd0a4109e96c90746174a4c5b2238c518 (diff) | |
Changed Areas on Windows to store their sysData inside the window memory instead of being given it via a closure. Actually having only one window class for all Areas comes next.
| -rw-r--r-- | area_windows.go | 6 | ||||
| -rw-r--r-- | sysdata_windows.go | 1 |
2 files changed, 6 insertions, 1 deletions
diff --git a/area_windows.go b/area_windows.go index 6708a27..35438e3 100644 --- a/area_windows.go +++ b/area_windows.go @@ -604,8 +604,12 @@ var ( _setFocus = user32.NewProc("SetFocus") ) -func areaWndProc(s *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { +func areaWndProc(unused *sysData) func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { return func(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESULT { + s := getSysData(hwnd) + if s == nil { // not yet saved + return storeSysData(hwnd, uMsg, wParam, lParam) + } switch uMsg { case _WM_PAINT: paintArea(s) diff --git a/sysdata_windows.go b/sysdata_windows.go index 06b2ac8..e6b6484 100644 --- a/sysdata_windows.go +++ b/sysdata_windows.go @@ -116,6 +116,7 @@ var classTypes = [nctypes]*classData{ register: registerAreaWndClass, style: areastyle, xstyle: areaxstyle, + storeSysData: true, doNotLoadFont: true, }, } |
