diff options
| author | Jeff Carr <[email protected]> | 2023-04-08 11:06:50 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-04-08 11:06:50 -0500 |
| commit | da6a4363226f14aa893be02cb4a73cbf34fd77e7 (patch) | |
| tree | 8f1f2c5d59e72961c87ff9c9ede0a4b3f2ab9c3f /common.go | |
| parent | fa0718ff48a2ac2f8b54aed3060101f159484c86 (diff) | |
andlabs: the binary tree limps along again
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 26 |
1 files changed, 21 insertions, 5 deletions
@@ -9,28 +9,44 @@ import ( // functions for handling text related GUI elements -func (n *Node) Show() { +func New() *Node { + if (Config.rootNode == nil) { + log(logError, "New() ERROR: rootNode is nil") + } + + // There should only be one of these per application + // This is due to restrictions by being cross platform + // some toolkit's on some operating systems don't support more than one + // Keep things simple. Do the default expected thing whenever possible + return startS("gocui") +} + +func (n *Node) Show() *Node { var a toolkit.Action a.ActionType = toolkit.Show newaction(&a, n, nil) + return n } -func (n *Node) Hide() { +func (n *Node) Hide() *Node { var a toolkit.Action a.ActionType = toolkit.Hide newaction(&a, n, nil) + return n } -func (n *Node) Enable() { +func (n *Node) Enable() *Node { var a toolkit.Action a.ActionType = toolkit.Enable newaction(&a, n, nil) + return n } -func (n *Node) Disable() { +func (n *Node) Disable() *Node { var a toolkit.Action a.ActionType = toolkit.Disable newaction(&a, n, nil) + return n } func (n *Node) Add(str string) { @@ -186,7 +202,7 @@ func (n *Node) Unpad() *Node { // is this better? // yes, this is better. it allows Internationalization very easily // me.window = myGui.New2().Window("DNS and IPv6 Control Panel").Standard() -// myFunnyWindow = myGui.New().Window("Hello").Standard().SetText("Hola") +// myFunnyWindow = myGui.NewWindow("Hello").Standard().SetText("Hola") func (n *Node) New2() *Node { log(debugNow, "New2() Start") |
