GOOD: use global 'Stretchy' setting
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
50a33262c1
commit
2af6db4d6c
2
box.go
2
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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
3
entry.go
3
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)
|
||||
|
|
1
gui.go
1
gui.go
|
@ -24,6 +24,7 @@ func init() {
|
|||
Config.prefix = "wit"
|
||||
Config.DebugNode = false
|
||||
Config.DebugTabs = false
|
||||
Config.Stretchy = true
|
||||
}
|
||||
|
||||
func GuiInit() {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -22,6 +22,7 @@ type GuiConfig struct {
|
|||
Title string
|
||||
Width int
|
||||
Height int
|
||||
Stretchy bool
|
||||
Exit func(*Node)
|
||||
|
||||
Debug bool
|
||||
|
|
Loading…
Reference in New Issue