Added the init and testing main functions and started fixing errors. Let's fix the rest and hope it works...
This commit is contained in:
parent
7686c6e599
commit
09a42e0c34
|
@ -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)
|
||||
}
|
||||
}
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
}
|
||||
|
|
@ -1,6 +1,8 @@
|
|||
// 7 february 2014
|
||||
package main
|
||||
|
||||
//+build skip
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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()")
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue