hidden settings seem to work
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
4ef833479c
commit
7012aff2ae
|
@ -56,12 +56,13 @@ func sendAction(n *Node, atype widget.ActionType) {
|
|||
a.State.Pad = n.pad
|
||||
a.State.Expand = n.expand
|
||||
a.State.Borderless = n.borderless
|
||||
|
||||
a.State.Direction = n.direction
|
||||
|
||||
for s, _ := range n.strings {
|
||||
a.State.Strings = append(a.State.Strings, s)
|
||||
}
|
||||
log.Warn("SENDING ACTION STRINGS a.Strings", a.Strings)
|
||||
log.Warn("SENDING ACTION a.State.Value", a.State.Value)
|
||||
a.State.Range.Low = n.X
|
||||
a.State.Range.High = n.Y
|
||||
|
||||
|
|
10
box.go
10
box.go
|
@ -19,6 +19,16 @@ func (parent *Node) NewBox(progname string, b bool) *Node {
|
|||
return newNode
|
||||
}
|
||||
|
||||
func (n *Node) Vertical() *Node {
|
||||
n.direction = widget.Horizontal
|
||||
return n
|
||||
}
|
||||
|
||||
func (n *Node) Horizontal() *Node {
|
||||
n.direction = widget.Horizontal
|
||||
return n
|
||||
}
|
||||
|
||||
func (parent *Node) NewHorizontalBox(progname string) *Node {
|
||||
newNode := parent.newNode(progname, widget.Box)
|
||||
newNode.progname = progname
|
||||
|
|
11
common.go
11
common.go
|
@ -119,6 +119,17 @@ func (n *Node) String() string {
|
|||
if !n.Ready() {
|
||||
return ""
|
||||
}
|
||||
switch n.WidgetType {
|
||||
case widget.Window:
|
||||
return n.label
|
||||
case widget.Button:
|
||||
return n.label
|
||||
case widget.Group:
|
||||
return n.label
|
||||
case widget.Label:
|
||||
return n.label
|
||||
default:
|
||||
}
|
||||
|
||||
return widget.GetString(n.value)
|
||||
}
|
||||
|
|
2
group.go
2
group.go
|
@ -13,6 +13,8 @@ func (parent *Node) NewGroup(name string) *Node {
|
|||
newNode.progname = name
|
||||
newNode.label = name
|
||||
|
||||
newNode.direction = widget.Vertical
|
||||
|
||||
// inform the toolkits
|
||||
sendAction(newNode, widget.Add)
|
||||
return newNode
|
||||
|
|
Loading…
Reference in New Issue