diff options
| author | Jeff Carr <[email protected]> | 2025-03-25 07:27:37 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-25 13:17:00 -0500 |
| commit | 1552eedc185e85b46498898e68867afaef308301 (patch) | |
| tree | 8fc5cdfbc77cde184842197b2cde5cce8d85d34b /treeAdd.go | |
| parent | 4523eda0fa2372d97fb5db800b79b53c218ef627 (diff) | |
save the output window state
Diffstat (limited to 'treeAdd.go')
| -rw-r--r-- | treeAdd.go | 117 |
1 files changed, 0 insertions, 117 deletions
diff --git a/treeAdd.go b/treeAdd.go deleted file mode 100644 index 6bb459b..0000000 --- a/treeAdd.go +++ /dev/null @@ -1,117 +0,0 @@ -// Copyright 2017-2025 WIT.COM Inc. All rights reserved. -// Use of this source code is governed by the GPL 3.0 - -package main - -import ( - log "go.wit.com/log" - "go.wit.com/toolkits/tree" - "go.wit.com/widget" -) - -var fakeStartWidth int = me.FakeW -var fakeStartHeight int = me.TabH + me.FramePadH - -// setup fake labels for non-visible things off screen -func setFake(n *tree.Node) { - var w *guiWidget - w = n.TK.(*guiWidget) - w.isFake = true - - w.gocuiSetWH(fakeStartWidth, fakeStartHeight) - - fakeStartHeight += w.gocuiSize.Height() - // TODO: use the actual max hight of the terminal window - if fakeStartHeight > 24 { - fakeStartHeight = me.TabH - fakeStartWidth += me.FakeW - } -} - -// mostly just sets the colors of things -func addWidget(n *tree.Node) { - if !me.ok { - log.Log(INFO, "addWidget() START NOT OKAY") - log.Log(INFO, "addWidget() START NOT OKAY") - log.Log(INFO, "addWidget() START NOT OKAY") - waitOK() - } - tk := n.TK.(*guiWidget) - log.Log(INFO, "setStartWH() w.id =", n.WidgetId, "n.name", n.String()) - switch n.WidgetType { - case widget.Root: - log.Log(INFO, "setStartWH() rootNode w.id =", n.WidgetId, "w.name", n.String()) - // tk.color = &colorRoot - setFake(n) - return - case widget.Flag: - // tk.color = &colorFlag - setFake(n) - return - case widget.Window: - tk.frame = false - tk.labelN = tk.GetText() + " X" - // tk.setColor(&colorWindow) - me.newWindowTrigger <- tk - redoWindows(0, 0) - return - case widget.Stdout: - tk.labelN = "moreSTDOUT" - n.State.ProgName = "moreSTDOUT" - n.State.Label = "moreSTDOUT" - tk.isFake = true - return - case widget.Tab: - // tk.color = &colorTab - return - case widget.Button: - tk.setColorButton() - if tk.IsEnabled() { - } else { - tk.setColorDisable() - } - return - case widget.Checkbox: - tk.setColorInput() - tk.labelN = "X " + n.State.Label - return - case widget.Dropdown: - tk.setColorInput() - return - case widget.Textbox: - n.State.Label = "" - tk.labelN = " " - // tk.color = &colorDropdown - tk.setColorInput() - return - case widget.Combobox: - // tk.color = &colorCombobox - tk.setColorInput() - return - case widget.Box: - // tk.color = &colorBox - tk.isFake = true - setFake(n) - return - case widget.Grid: - // tk.color = &colorGrid - tk.isFake = true - setFake(n) - return - case widget.Group: - tk.setColorLabel() - tk.frame = false - return - case widget.Label: - tk.setColorLabel() - tk.frame = false - return - default: - /* - if n.IsCurrent() { - n.updateCurrent() - } - */ - } - tk.dumpWidget("addWidget()unknown") -} |
