summaryrefslogtreecommitdiff
path: root/tab.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2022-10-17 00:38:27 -0500
committerJeff Carr <[email protected]>2022-10-17 00:38:27 -0500
commit4bb18caa3ac7da14b7333d258b40b87272c9e65b (patch)
tree7cfcf321c9f4f31a6ca692df22aa79870eee2be2 /tab.go
parent1ca14e9c2a011e51d54eee8226c8ca85eb01cc14 (diff)
start moving tab handling into toolkit/v0.3.2
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tab.go')
-rw-r--r--tab.go40
1 files changed, 40 insertions, 0 deletions
diff --git a/tab.go b/tab.go
new file mode 100644
index 0000000..85afca1
--- /dev/null
+++ b/tab.go
@@ -0,0 +1,40 @@
+package gui
+
+import (
+ "log"
+// "fmt"
+
+ "github.com/andlabs/ui"
+ _ "github.com/andlabs/ui/winmanifest"
+
+)
+
+// import toolkit "git.wit.org/wit/gui/toolkit/andlabs"
+
+func (n *Node) AddTabRaw(title string, uiC ui.Control) *Node {
+ log.Println("gui.Node.AddTabRaw()")
+
+ tab := n.uiTab
+ if (tab == nil) {
+ log.Println("gui.Node.AddTabRaw() FAIL tab == nil")
+ return n
+ }
+
+ if (uiC == nil) {
+ // hbox := ui.NewHorizontalBox()
+ // hbox.SetPadded(true)
+ // uiC = hbox
+ log.Println("gui.Node.AddTabRaw() FAIL *ui.Control == nil")
+ return n
+ }
+ tab.Append(title, uiC)
+
+ /*
+ newNode := parent.makeNode(title, 555, 600 + Config.counter)
+ newNode.uiTab = tab
+ newNode.uiBox = uiC
+ // panic("gui.AddTab() after makeNode()")
+ tabSetMargined(newNode.uiTab)
+ */
+ return n
+}