BOX: start removing GuiBox
Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
e7bcb14d6c
commit
b90d7b96c3
|
@ -19,6 +19,7 @@ import _ "github.com/andlabs/ui/winmanifest"
|
||||||
// There is a []GuiButton which has all the buttons. We search
|
// There is a []GuiButton which has all the buttons. We search
|
||||||
// for the button and then call the function below
|
// for the button and then call the function below
|
||||||
//
|
//
|
||||||
|
/*
|
||||||
func defaultButtonClick(button *ui.Button) {
|
func defaultButtonClick(button *ui.Button) {
|
||||||
log.Println("gui.defaultButtonClick() LOOK FOR BUTTON button =", button)
|
log.Println("gui.defaultButtonClick() LOOK FOR BUTTON button =", button)
|
||||||
for key, foo := range Data.AllButtons {
|
for key, foo := range Data.AllButtons {
|
||||||
|
@ -51,6 +52,7 @@ func guiButtonClick(button *GuiButton) {
|
||||||
log.Println("\tgui.guiButtonClick() IGNORING BUTTON. MouseClick() is nil")
|
log.Println("\tgui.guiButtonClick() IGNORING BUTTON. MouseClick() is nil")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func (n *Node) AddButton(name string, custom func(*Node)) *Node {
|
func (n *Node) AddButton(name string, custom func(*Node)) *Node {
|
||||||
if (n.uiBox == nil) {
|
if (n.uiBox == nil) {
|
||||||
|
@ -60,6 +62,7 @@ func (n *Node) AddButton(name string, custom func(*Node)) *Node {
|
||||||
button := ui.NewButton(name)
|
button := ui.NewButton(name)
|
||||||
log.Println("reflect.TypeOF(uiBox) =", reflect.TypeOf(n.uiBox))
|
log.Println("reflect.TypeOF(uiBox) =", reflect.TypeOf(n.uiBox))
|
||||||
log.Println("reflect.TypeOF(uiButton) =", reflect.TypeOf(button))
|
log.Println("reflect.TypeOF(uiButton) =", reflect.TypeOf(button))
|
||||||
|
// true == expand, false == make normal size button
|
||||||
n.uiBox.Append(button, false)
|
n.uiBox.Append(button, false)
|
||||||
n.uiButton = button
|
n.uiButton = button
|
||||||
|
|
||||||
|
@ -76,6 +79,7 @@ func (n *Node) AddButton(name string, custom func(*Node)) *Node {
|
||||||
return newNode
|
return newNode
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func (n *Node) CreateButton(custom func(*GuiButton), name string, values interface {}) *Node {
|
func (n *Node) CreateButton(custom func(*GuiButton), name string, values interface {}) *Node {
|
||||||
newNode := n.AddBox(Xaxis, "test CreateButton")
|
newNode := n.AddBox(Xaxis, "test CreateButton")
|
||||||
box := newNode.FindBox()
|
box := newNode.FindBox()
|
||||||
|
@ -127,6 +131,7 @@ func CreateButton(box *GuiBox, custom func(*GuiButton), name string, values inte
|
||||||
box.Append(newB.B, false)
|
box.Append(newB.B, false)
|
||||||
return newB
|
return newB
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func CreateFontButton(box *GuiBox, action string) *GuiButton {
|
func CreateFontButton(box *GuiBox, action string) *GuiButton {
|
||||||
// create a 'fake' button entry for the mouse clicks
|
// create a 'fake' button entry for the mouse clicks
|
||||||
|
|
|
@ -97,7 +97,8 @@ func defaultSetCellValue(mh *TableData, row int, column int) {
|
||||||
|
|
||||||
button := mh.Rows[row].HumanData[humanID].Button
|
button := mh.Rows[row].HumanData[humanID].Button
|
||||||
if (button != nil) {
|
if (button != nil) {
|
||||||
guiButtonClick(button)
|
// TODO: fixme. removed on Oct 31 2021
|
||||||
|
// guiButtonClick(button)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
log.Println("defaultSetCellValue() ERROR: UNKNOWN BUTTON IN TABLE")
|
log.Println("defaultSetCellValue() ERROR: UNKNOWN BUTTON IN TABLE")
|
||||||
|
|
Loading…
Reference in New Issue