work on handling Direction
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
f48b950655
commit
d15fa1cf88
|
@ -231,6 +231,7 @@ func processAction(a *widget.Action) {
|
||||||
case widget.Set:
|
case widget.Set:
|
||||||
setText(n, a)
|
setText(n, a)
|
||||||
case widget.SetText:
|
case widget.SetText:
|
||||||
|
log.Warn("andlabs SetText wid =", n.WidgetId, n.State.Value, a.State.Value)
|
||||||
setText(n, a)
|
setText(n, a)
|
||||||
case widget.AddText:
|
case widget.AddText:
|
||||||
addText(n, a)
|
addText(n, a)
|
||||||
|
|
1
place.go
1
place.go
|
@ -72,6 +72,7 @@ func place(p *tree.Node, n *tree.Node) bool {
|
||||||
case widget.Group:
|
case widget.Group:
|
||||||
if ptk.uiBox == nil {
|
if ptk.uiBox == nil {
|
||||||
log.Log(WARN, "place() andlabs hack group to use add a box", n.GetProgName(), n.WidgetType)
|
log.Log(WARN, "place() andlabs hack group to use add a box", n.GetProgName(), n.WidgetType)
|
||||||
|
n.State.Direction = widget.Vertical
|
||||||
ptk.uiBox = rawBox(n)
|
ptk.uiBox = rawBox(n)
|
||||||
ptk.uiGroup.SetChild(ptk.uiBox)
|
ptk.uiGroup.SetChild(ptk.uiBox)
|
||||||
}
|
}
|
||||||
|
|
10
setText.go
10
setText.go
|
@ -22,12 +22,12 @@ func setText(n *tree.Node, a *widget.Action) {
|
||||||
switch n.WidgetType {
|
switch n.WidgetType {
|
||||||
case widget.Window:
|
case widget.Window:
|
||||||
log.Warn("setText() Attempt to set the title to", name)
|
log.Warn("setText() Attempt to set the title to", name)
|
||||||
tk.uiWindow.SetTitle(name)
|
tk.uiWindow.SetTitle(a.State.Label)
|
||||||
case widget.Tab:
|
case widget.Tab:
|
||||||
case widget.Group:
|
case widget.Group:
|
||||||
tk.uiGroup.SetTitle(name)
|
tk.uiGroup.SetTitle(a.State.Label)
|
||||||
case widget.Checkbox:
|
case widget.Checkbox:
|
||||||
tk.uiCheckbox.SetText(name)
|
tk.uiCheckbox.SetText(a.State.Label)
|
||||||
case widget.Textbox:
|
case widget.Textbox:
|
||||||
if tk.uiEntry != nil {
|
if tk.uiEntry != nil {
|
||||||
tk.uiEntry.SetText(name)
|
tk.uiEntry.SetText(name)
|
||||||
|
@ -36,9 +36,9 @@ func setText(n *tree.Node, a *widget.Action) {
|
||||||
tk.uiMultilineEntry.SetText(name)
|
tk.uiMultilineEntry.SetText(name)
|
||||||
}
|
}
|
||||||
case widget.Label:
|
case widget.Label:
|
||||||
tk.uiLabel.SetText(name)
|
tk.uiLabel.SetText(a.State.Label)
|
||||||
case widget.Button:
|
case widget.Button:
|
||||||
tk.uiButton.SetText(name)
|
tk.uiButton.SetText(a.State.Label)
|
||||||
case widget.Slider:
|
case widget.Slider:
|
||||||
log.Log(ERROR, "setText() on slider unknown", a.ActionType, "on checkbox", n.GetProgName())
|
log.Log(ERROR, "setText() on slider unknown", a.ActionType, "on checkbox", n.GetProgName())
|
||||||
case widget.Spinner:
|
case widget.Spinner:
|
||||||
|
|
|
@ -20,7 +20,7 @@ func newWindow(p, n *tree.Node) {
|
||||||
newt = new(guiWidget)
|
newt = new(guiWidget)
|
||||||
|
|
||||||
// bool == false is if the OS defined border on the window should be used
|
// bool == false is if the OS defined border on the window should be used
|
||||||
win := ui.NewWindow(n.GetProgName(), 640, 480, n.State.Borderless)
|
win := ui.NewWindow(n.GetProgName(), 40, 40, n.State.Borderless)
|
||||||
win.SetBorderless(n.State.Borderless)
|
win.SetBorderless(n.State.Borderless)
|
||||||
win.SetMargined(n.State.Pad)
|
win.SetMargined(n.State.Pad)
|
||||||
win.OnClosing(func(*ui.Window) bool {
|
win.OnClosing(func(*ui.Window) bool {
|
||||||
|
|
Loading…
Reference in New Issue