parent
dfaa789464
commit
3f3dee0ea5
|
@ -125,7 +125,7 @@ func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
og = w.Box().NewGroup("output").Pad()
|
og = w.Box().NewGroup("output").Pad()
|
||||||
outputTextbox = og.NewTextbox("outputBox")
|
outputTextbox = og.NewTextbox("outputBox")
|
||||||
outputTextbox.Custom = func () {
|
outputTextbox.Custom = func () {
|
||||||
log.Log(INFO, "custom TextBox() for golang output a =", outputTextbox.S)
|
log.Log(INFO, "custom TextBox() for golang output a =", outputTextbox.GetText())
|
||||||
}
|
}
|
||||||
|
|
||||||
return w
|
return w
|
||||||
|
|
4
main.go
4
main.go
|
@ -134,7 +134,7 @@ func dropdownWindow(p *gui.Node) {
|
||||||
|
|
||||||
dd := p.NewDropdown("Window Dropdown")
|
dd := p.NewDropdown("Window Dropdown")
|
||||||
dd.Custom = func() {
|
dd.Custom = func() {
|
||||||
name := dd.S
|
name := dd.GetText()
|
||||||
activeWidget = mapWindows[name]
|
activeWidget = mapWindows[name]
|
||||||
setActiveWidget(activeWidget)
|
setActiveWidget(activeWidget)
|
||||||
log.Log(INFO, "The Window was set to", name)
|
log.Log(INFO, "The Window was set to", name)
|
||||||
|
@ -165,7 +165,7 @@ func dropdownWindowWidgets(p *gui.Node) {
|
||||||
|
|
||||||
dd := p.NewDropdown("Window Widgets Dropdown")
|
dd := p.NewDropdown("Window Widgets Dropdown")
|
||||||
dd.Custom = func() {
|
dd.Custom = func() {
|
||||||
name := dd.S
|
name := dd.GetText()
|
||||||
activeWidget = mapWindows[name]
|
activeWidget = mapWindows[name]
|
||||||
setActiveWidget(activeWidget)
|
setActiveWidget(activeWidget)
|
||||||
}
|
}
|
||||||
|
|
28
widget.go
28
widget.go
|
@ -84,7 +84,7 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
|
|
||||||
g = w.Box().NewGroup("change things")
|
g = w.Box().NewGroup("change things")
|
||||||
g.NewButton("AddText()", func () {
|
g.NewButton("AddText()", func () {
|
||||||
activeWidget.AddText(activeLabelNewName.S)
|
activeWidget.AddText(activeLabelNewName.GetText())
|
||||||
/*
|
/*
|
||||||
activeWidget.S = activeLabelNewName.S
|
activeWidget.S = activeLabelNewName.S
|
||||||
a := newAction(activeWidget, toolkit.AddText)
|
a := newAction(activeWidget, toolkit.AddText)
|
||||||
|
@ -92,9 +92,9 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||||
*/
|
*/
|
||||||
})
|
})
|
||||||
g.NewButton("SetText()", func () {
|
g.NewButton("SetText()", func () {
|
||||||
activeWidget.SetText(activeLabelNewName.S)
|
activeWidget.SetText(activeLabelNewName.GetText())
|
||||||
/*
|
/*
|
||||||
activeWidget.S = activeLabelNewName.S
|
activeWidget.S = activeLabelNewName.GetText()
|
||||||
a := newAction(activeWidget, toolkit.SetText)
|
a := newAction(activeWidget, toolkit.SetText)
|
||||||
sendAction(a)
|
sendAction(a)
|
||||||
*/
|
*/
|
||||||
|
@ -140,7 +140,7 @@ func debugAddWidgetButtons(n *gui.Node) {
|
||||||
a.AddText("make something for tim for qflow")
|
a.AddText("make something for tim for qflow")
|
||||||
a.AddText("and for riscv")
|
a.AddText("and for riscv")
|
||||||
a.Custom = func () {
|
a.Custom = func () {
|
||||||
log.Log(WARN, "custom dropdown() a =", a.ProgName(), a.S)
|
log.Log(WARN, "custom dropdown() a =", a.ProgName(), a.GetText())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
n.NewButton("Combobox", func () {
|
n.NewButton("Combobox", func () {
|
||||||
|
@ -148,7 +148,7 @@ func debugAddWidgetButtons(n *gui.Node) {
|
||||||
a.AddText("mirrors.wit.com")
|
a.AddText("mirrors.wit.com")
|
||||||
a.AddText("go.wit.com")
|
a.AddText("go.wit.com")
|
||||||
a.Custom = func () {
|
a.Custom = func () {
|
||||||
log.Log(WARN, "custom combobox() a =", a.ProgName(), a.S)
|
log.Log(WARN, "custom combobox() a =", a.ProgName(), a.GetText())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
n.NewButton("Grid", func () {
|
n.NewButton("Grid", func () {
|
||||||
|
@ -211,10 +211,10 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
activeLabelNewType.AddText("Dialog")
|
activeLabelNewType.AddText("Dialog")
|
||||||
|
|
||||||
n.NewButton("Add", func () {
|
n.NewButton("Add", func () {
|
||||||
name := activeLabelNewName.S
|
name := activeLabelNewName.GetText()
|
||||||
newX := activeLabelNewX.I
|
newX := activeLabelNewX.GetInt()
|
||||||
newY := activeLabelNewY.I
|
newY := activeLabelNewY.GetInt()
|
||||||
newB := activeLabelNewB.B
|
newB := activeLabelNewB.GetBool()
|
||||||
|
|
||||||
if (newY == -1) {
|
if (newY == -1) {
|
||||||
name = name + " (" + strconv.Itoa(activeWidget.NextW) + "," + strconv.Itoa(activeWidget.NextH) + ")"
|
name = name + " (" + strconv.Itoa(activeWidget.NextW) + "," + strconv.Itoa(activeWidget.NextH) + ")"
|
||||||
|
@ -223,7 +223,7 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
name = name + " (" + strconv.Itoa(newX) + "," + strconv.Itoa(newY) + ")"
|
name = name + " (" + strconv.Itoa(newX) + "," + strconv.Itoa(newY) + ")"
|
||||||
}
|
}
|
||||||
log.Log(INFO, "New Name =", name)
|
log.Log(INFO, "New Name =", name)
|
||||||
log.Log(INFO, "New Type =", activeLabelNewType.S)
|
log.Log(INFO, "New Type =", activeLabelNewType.GetText())
|
||||||
log.Log(INFO, "New X =", newX)
|
log.Log(INFO, "New X =", newX)
|
||||||
log.Log(INFO, "New Y =", newY)
|
log.Log(INFO, "New Y =", newY)
|
||||||
log.Log(INFO, "activeWidget.NextW =", activeWidget.NextW)
|
log.Log(INFO, "activeWidget.NextW =", activeWidget.NextW)
|
||||||
|
@ -234,7 +234,7 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
// activeWidget.X = newX
|
// activeWidget.X = newX
|
||||||
// activeWidget.Y = newY
|
// activeWidget.Y = newY
|
||||||
|
|
||||||
switch activeLabelNewType.S {
|
switch activeLabelNewType.GetText() {
|
||||||
case "Grid":
|
case "Grid":
|
||||||
activeWidget.NewGrid(name, newX, newY)
|
activeWidget.NewGrid(name, newX, newY)
|
||||||
case "Group":
|
case "Group":
|
||||||
|
@ -248,14 +248,14 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
case "Checkbox":
|
case "Checkbox":
|
||||||
a := activeWidget.NewCheckbox(name)
|
a := activeWidget.NewCheckbox(name)
|
||||||
a.Custom = func () {
|
a.Custom = func () {
|
||||||
log.Log(WARN, "custom checkox func a=", a.B)
|
log.Log(WARN, "custom checkox func a=", a.GetBool())
|
||||||
}
|
}
|
||||||
case "Dropdown":
|
case "Dropdown":
|
||||||
a := activeWidget.NewDropdown(name)
|
a := activeWidget.NewDropdown(name)
|
||||||
a.AddText(name + " yay")
|
a.AddText(name + " yay")
|
||||||
a.AddText(name + " haha")
|
a.AddText(name + " haha")
|
||||||
a.Custom = func () {
|
a.Custom = func () {
|
||||||
log.Log(WARN, "WTF a=", a.B)
|
log.Log(WARN, "WTF a=", a.GetBool())
|
||||||
}
|
}
|
||||||
case "Combobox":
|
case "Combobox":
|
||||||
a := activeWidget.NewCombobox(name)
|
a := activeWidget.NewCombobox(name)
|
||||||
|
@ -270,7 +270,7 @@ func debugAddWidgetButton(n *gui.Node) {
|
||||||
case "Spinner":
|
case "Spinner":
|
||||||
activeWidget.NewSpinner(name, newX, newY)
|
activeWidget.NewSpinner(name, newX, newY)
|
||||||
default:
|
default:
|
||||||
log.Error(errors.New("make what type?"), activeLabelNewType.S)
|
log.Error(errors.New("make what type?"), activeLabelNewType.GetText())
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue