summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--init.go17
-rw-r--r--init_windows.go2
-rw-r--r--main.go11
-rw-r--r--main_windows.go2
-rw-r--r--stdwndclass_windows.go3
-rw-r--r--sysdata.go2
6 files changed, 33 insertions, 4 deletions
diff --git a/init.go b/init.go
new file mode 100644
index 0000000..799add6
--- /dev/null
+++ b/init.go
@@ -0,0 +1,17 @@
+// 11 february 2014
+//package ui
+package main
+
+// TODO this will be system-defined
+func initpanic(err error) {
+ panic("failure during init: " + err.Error())
+}
+
+func init() {
+ initDone := make(chan error)
+ go ui(initDone)
+ err := <-initDone
+ if err != nil {
+ initpanic(err)
+ }
+}
diff --git a/init_windows.go b/init_windows.go
index 8e39e2b..a4a0d7f 100644
--- a/init_windows.go
+++ b/init_windows.go
@@ -69,7 +69,7 @@ func doWindowsInit() (err error) {
}
err = registerStdWndClass()
if err != nil {
- reteurn fmt.Errorf("error registering standard window class: %v", err)
+ return fmt.Errorf("error registering standard window class: %v", err)
}
// TODO others
return nil // all ready to go
diff --git a/main.go b/main.go
new file mode 100644
index 0000000..a20a745
--- /dev/null
+++ b/main.go
@@ -0,0 +1,11 @@
+// 11 february 2014
+package main
+
+func main() {
+ w := NewWindow("Main Window")
+ w.Closing = make(chan struct{})
+ w.Open()
+ <-w.Closing
+ w.Close()
+}
+
diff --git a/main_windows.go b/main_windows.go
index 93aa4a1..68000da 100644
--- a/main_windows.go
+++ b/main_windows.go
@@ -1,6 +1,8 @@
// 7 february 2014
package main
+//+build skip
+
import (
"fmt"
"os"
diff --git a/stdwndclass_windows.go b/stdwndclass_windows.go
index 730cd51..e3eafa8 100644
--- a/stdwndclass_windows.go
+++ b/stdwndclass_windows.go
@@ -5,7 +5,6 @@ import (
"fmt"
"syscall"
"unsafe"
- "sync"
)
const (
@@ -34,7 +33,7 @@ func stdWndProc(hwnd _HWND, uMsg uint32, wParam _WPARAM, lParam _LPARAM) _LRESUL
return 0
case _WM_CLOSE:
if sysData.closing != nil {
- sysData.closing <- struct{}
+ sysData.closing <- struct{}{}
}
return 0
default:
diff --git a/sysdata.go b/sysdata.go
index 298c1ef..6f3c076 100644
--- a/sysdata.go
+++ b/sysdata.go
@@ -19,7 +19,7 @@ func (c *cSysData) make() error {
func (c *cSysData) show() error {
panic(runtime.GOOS + " sysData does not define show()")
}
-func (c *cSysData) show() error {
+func (c *cSysData) hide() error {
panic(runtime.GOOS + " sysData does not define hide()")
}