summaryrefslogtreecommitdiff
path: root/sysdata_windows.go
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-02-12 21:28:58 -0500
committerPietro Gagliardi <[email protected]>2014-02-12 21:28:58 -0500
commit8e2f3b136e041705098f9f8d11941c33f785258a (patch)
tree312da7cb31bf0348d7517f4be98d3c22b5c04445 /sysdata_windows.go
parent40dc20be0d7141ccc6263b88e005c16378daa8ce (diff)
Adjusted sysData.make() to make the new window class and fixed main(). Now to fix compiler errors...
Diffstat (limited to 'sysdata_windows.go')
-rw-r--r--sysdata_windows.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/sysdata_windows.go b/sysdata_windows.go
index fc6b8c8..ab65879 100644
--- a/sysdata_windows.go
+++ b/sysdata_windows.go
@@ -30,7 +30,6 @@ const controlxstyle = 0
var classTypes = [nctypes]*classData{
c_window: &classData{
- name: stdWndClass,
style: _WS_OVERLAPPEDWINDOW,
xstyle: 0,
},
@@ -59,17 +58,24 @@ func (s *sysData) make(initText string, initWidth int, initHeight int, window *s
ret := make(chan uiret)
defer close(ret)
ct := classTypes[s.ctype]
+ classname := ct.name
cid := _HMENU(0)
pwin := uintptr(_NULL)
if window != nil { // this is a child control
cid = window.addChild(s)
pwin = uintptr(window.hwnd)
+ } else { // need a new class
+ n, err := registerStdWndClass(s)
+ if err != nil {
+ return r.err
+ }
+ classname = n
}
uitask <- &uimsg{
call: _createWindowEx,
p: []uintptr{
uintptr(ct.xstyle),
- uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(ct.name))),
+ uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(classname))),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(initText))),
uintptr(ct.style),
uintptr(_CW_USEDEFAULT), // TODO