Cleaned up the classType struct and sysData.make() in sysdata_windows.go to remove unused fields and the window class registration code now that we no longer register window classes on the fly for each new Window/Area.

This commit is contained in:
Pietro Gagliardi 2014-05-30 23:07:19 -04:00
parent 2e0914e575
commit 09f5c7764e
1 changed files with 1 additions and 11 deletions

View File

@ -25,10 +25,8 @@ type sysData struct {
type classData struct {
name string
register func(s *sysData) (newClassName string, err error)
style uint32
xstyle uint32
mkid bool
altStyle uint32
storeSysData bool
doNotLoadFont bool
@ -142,20 +140,12 @@ func (s *sysData) make(window *sysData) (err error) {
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)
}
if classname == "" { // need a new window class
n, err := ct.register(s)
if err != nil {
return fmt.Errorf("error creating window class for new window/control (type %d): %v", s.ctype, err)
}
classname = n
}
style := uintptr(ct.style)
if s.alternate {
style = uintptr(ct.altStyle)
@ -168,7 +158,7 @@ func (s *sysData) make(window *sysData) (err error) {
call: _createWindowEx,
p: []uintptr{
uintptr(ct.xstyle),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(classname))),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(ct.name))),
uintptr(unsafe.Pointer(syscall.StringToUTF16Ptr(""))), // we set the window text later
style,
negConst(_CW_USEDEFAULT),