summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--box.go2
-rw-r--r--button.go4
-rw-r--r--debug-window.go6
-rw-r--r--demo-window.go22
-rw-r--r--entry.go3
-rw-r--r--gui.go1
-rw-r--r--new-structs.go6
-rw-r--r--structs.go1
8 files changed, 14 insertions, 31 deletions
diff --git a/box.go b/box.go
index 65a8d39..5b4febe 100644
--- a/box.go
+++ b/box.go
@@ -37,7 +37,7 @@ func (n *Node) AddComboBox(title string, s ...string) *Node {
}
})
- box.Append(ecbox, false)
+ box.Append(ecbox, Config.Stretchy)
return newNode
}
diff --git a/button.go b/button.go
index ef73f73..9895ed8 100644
--- a/button.go
+++ b/button.go
@@ -32,7 +32,7 @@ func (n *Node) AddButton(name string, custom func(*Node)) *Node {
log.Println("reflect.TypeOF(uiButton) =", reflect.TypeOf(button))
}
// true == expand, false == make normal size button
- n.uiBox.Append(button, false)
+ n.uiBox.Append(button, Config.Stretchy)
n.uiButton = button
newNode := n.makeNode(name, 888, 888 + Config.counter)
@@ -73,6 +73,6 @@ func (n *Node) CreateColorButton(custom func(*Node), name string, values interfa
Data.MouseClick(n)
}
})
- n.uiBox.Append(n.uiColorButton, false)
+ n.uiBox.Append(n.uiColorButton, Config.Stretchy)
return n
}
diff --git a/debug-window.go b/debug-window.go
index 288d433..72272ec 100644
--- a/debug-window.go
+++ b/debug-window.go
@@ -46,7 +46,7 @@ func makeWindowDebug() *ui.Box {
}
nodeCombo.SetSelected(0)
- nodeBox.Append(nodeCombo, false)
+ nodeBox.Append(nodeCombo, Config.Stretchy)
nodeCombo.OnSelected(func(*ui.Combobox) {
y := nodeCombo.Selected()
@@ -148,7 +148,7 @@ func addName(c *ui.Combobox, s string) {
func addGroup(b *ui.Box, name string) *ui.Box {
group := ui.NewGroup(name)
group.SetMargined(true)
- b.Append(group, true)
+ b.Append(group, Config.Stretchy)
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
@@ -164,7 +164,7 @@ func addButton(box *ui.Box, name string) *ui.Button {
log.Println("Should do something here")
})
- box.Append(button, false)
+ box.Append(button, Config.Stretchy)
return button
}
diff --git a/demo-window.go b/demo-window.go
index 3d17c35..6cbb5fd 100644
--- a/demo-window.go
+++ b/demo-window.go
@@ -16,7 +16,7 @@ func (n *Node) AddGroup(title string) *Node {
}
group := ui.NewGroup(title)
group.SetMargined(true)
- hbox.Append(group, true)
+ hbox.Append(group, Config.Stretchy)
vbox := ui.NewVerticalBox()
vbox.SetPadded(true)
@@ -77,7 +77,7 @@ func (n *Node) MakeGroupEdit(title string) *Node {
group := ui.NewGroup(title)
group.SetMargined(true)
- n.uiBox.Append(group, true)
+ n.uiBox.Append(group, Config.Stretchy)
entrybox := ui.NewNonWrappingMultilineEntry()
@@ -89,22 +89,4 @@ func (n *Node) MakeGroupEdit(title string) *Node {
newNode.uiMultilineEntry = entrybox
newNode.uiGroup = group
return newNode
-
-/*
- panic("dump")
- entryForm := ui.NewForm()
- entryForm.SetPadded(true)
- group.SetChild(entryForm)
-
- entryForm.Append("Entry", ui.NewEntry(), false)
- entryForm.Append("Password Entry", ui.NewPasswordEntry(), false)
- entryForm.Append("Search Entry", ui.NewSearchEntry(), false)
- entryForm.Append("Multiline Entry", ui.NewMultilineEntry(), true)
- entryForm.Append("Multiline Entry No Wrap", ui.NewNonWrappingMultilineEntry(), true)
-
- origbox.Append(vbox, false)
- newNode := n.AddNode(title)
- newNode.uiBox = vbox
-*/
- return n
}
diff --git a/entry.go b/entry.go
index a69adba..539c2f7 100644
--- a/entry.go
+++ b/entry.go
@@ -12,8 +12,7 @@ import _ "github.com/andlabs/ui/winmanifest"
func (n *Node) NewLabel(text string) *Node {
// make new node here
- // n.Append(ui.NewLabel(text), false)
- newNode := n.makeNode(text, 333, 334)
+newNode := n.makeNode(text, 333, 334)
newNode.Dump()
n.Append(newNode)
diff --git a/gui.go b/gui.go
index 88554c8..6f7a236 100644
--- a/gui.go
+++ b/gui.go
@@ -24,6 +24,7 @@ func init() {
Config.prefix = "wit"
Config.DebugNode = false
Config.DebugTabs = false
+ Config.Stretchy = true
}
func GuiInit() {
diff --git a/new-structs.go b/new-structs.go
index 5bceae2..e6b947e 100644
--- a/new-structs.go
+++ b/new-structs.go
@@ -242,7 +242,7 @@ func (n *Node) AddHorizontalBreak() *Node {
log.Println("AddHorizontalBreak added to node =", n.Name)
if (n.uiBox != nil) {
tmp := ui.NewHorizontalSeparator()
- n.uiBox.Append(tmp, false)
+ n.uiBox.Append(tmp, Config.Stretchy)
} else {
n.Dump()
return nil
@@ -254,7 +254,7 @@ func (n *Node) AddVerticalBreak() *Node {
log.Println("AddVerticalBreak added to node =", n.Name)
if (n.uiBox != nil) {
tmp := ui.NewVerticalSeparator()
- n.uiBox.Append(tmp, false)
+ n.uiBox.Append(tmp, Config.Stretchy)
} else {
n.Dump()
return nil
@@ -267,7 +267,7 @@ func (n *Node) AddHorizontalBox(title string) *Node {
hbox.SetPadded(true)
if (n.uiBox != nil) {
log.Println("add new hbox to uiBox =", n.uiBox)
- n.uiBox.Append(hbox, false)
+ n.uiBox.Append(hbox, Config.Stretchy)
newNode := n.makeNode(title, 333, 333 + Config.counter)
newNode.parent = n
newNode.uiBox = hbox
diff --git a/structs.go b/structs.go
index 223ec4d..d82e621 100644
--- a/structs.go
+++ b/structs.go
@@ -22,6 +22,7 @@ type GuiConfig struct {
Title string
Width int
Height int
+ Stretchy bool
Exit func(*Node)
Debug bool