Added button events.

This commit is contained in:
Pietro Gagliardi 2014-02-12 11:32:17 -05:00
parent ddfb5c7603
commit 5f587fbf47
2 changed files with 11 additions and 3 deletions

View File

@ -22,9 +22,14 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL
}
switch uMsg {
case _WM_COMMAND:
id := wParam.LOWORD()
// ... member events
_ = id
id := _HMENU(wParam.LOWORD())
sysData = getSysDataID(id)
switch sysData.ctype {
case c_button:
if wParam.HIWORD() == _BN_CLICKED {
sysData.clicked <- struct{}{}
}
}
return 0
case _WM_GETMINMAXINFO:
mm := lParam.MINMAXINFO()

View File

@ -12,6 +12,9 @@ type cSysData struct {
// for Window
closing chan struct{}
// for Button
clicked chan struct{}
}
func (c *cSysData) make(initText string, initWidth int, initHeight int) error {
panic(runtime.GOOS + " sysData does not define make()")