andlabs-ui/sysdata.go

57 lines
1.4 KiB
Go
Raw Normal View History

// 11 february 2014
package main
import (
"runtime"
)
// The sysData type contains all system data. It provides the system-specific underlying implementation. It is guaranteed to have the following by embedding:
type cSysData struct {
2014-02-12 19:57:30 -06:00
ctype int
event chan struct{}
resize func(x int, y int, width int, height int) error
2014-02-14 11:16:27 -06:00
editable bool // for Combobox
}
func (c *cSysData) make(initText string, initWidth int, initHeight int, window *sysData) error {
panic(runtime.GOOS + " sysData does not define make()")
}
func (c *cSysData) show() error {
panic(runtime.GOOS + " sysData does not define show()")
}
func (c *cSysData) hide() error {
panic(runtime.GOOS + " sysData does not define hide()")
}
func (c *cSysData) setText(text string) error {
panic(runtime.GOOS + " sysData does not define setText()")
}
func (c *cSysData) setRect(x int, y int, width int, height int) error {
panic(runtime.GOOS + " sysData does not define setRect()")
}
2014-02-13 14:14:10 -06:00
func (c *cSysData) isChecked() (bool, error) {
panic(runtime.GOOS + " sysData does not define isChecked()")
}
2014-02-14 11:16:27 -06:00
func (c *cSysData) text() (string, error) {
panic(runtime.GOOS + " sysData does not define text()")
}
func (c *cSysData) append(string) error {
panic(runtime.GOOS + " sysData does not define append()")
}
// TODO insertAfter
const (
c_window = iota
c_button
c_checkbox
2014-02-14 11:16:27 -06:00
c_combobox
2014-02-14 14:00:59 -06:00
c_lineedit
nctypes
)
func mksysdata(ctype int) *sysData {
return &sysData{
cSysData: cSysData{
ctype: ctype,
},
}
}