parent
eca2f2aa48
commit
44ee09f798
3
click.go
3
click.go
|
@ -309,6 +309,9 @@ func findUnderMouse() *tree.Node {
|
|||
var widget *guiWidget
|
||||
widget = n.TK.(*guiWidget)
|
||||
// ignore widgets that are not visible
|
||||
if widget.node.WidgetId == 2222 {
|
||||
widget.SetVisible(false)
|
||||
}
|
||||
if widget.Visible() {
|
||||
if (widget.gocuiSize.w0 <= w) && (w <= widget.gocuiSize.w1) &&
|
||||
(widget.gocuiSize.h0 <= h) && (h <= widget.gocuiSize.h1) {
|
||||
|
|
2
debug.go
2
debug.go
|
@ -8,7 +8,7 @@ import (
|
|||
)
|
||||
|
||||
func (w *guiWidget) dumpTree(draw bool) {
|
||||
log.Log(ERROR, "dumpTree w", w.node.WidgetId, w.WidgetType, w.String())
|
||||
// log.Log(ERROR, "dumpTree w", w.node.WidgetId, w.WidgetType, w.String())
|
||||
if w == nil {
|
||||
log.Log(ERROR, "dumpTree w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
|
||||
return
|
||||
|
|
|
@ -109,7 +109,7 @@ func (w *guiWidget) SetVisible(b bool) {
|
|||
func addDropdown() *tree.Node {
|
||||
n := new(tree.Node)
|
||||
n.WidgetType = widget.Flag
|
||||
n.WidgetId = -2
|
||||
n.WidgetId = 2222
|
||||
n.ParentId = 0
|
||||
|
||||
// store the internal toolkit information
|
||||
|
@ -128,7 +128,9 @@ func addDropdown() *tree.Node {
|
|||
|
||||
// add this new widget on the binary tree
|
||||
tk.parent = me.treeRoot.TK.(*guiWidget)
|
||||
if tk.parent != nil {
|
||||
if tk.parent == nil {
|
||||
panic("addDropdown() didn't get treeRoot guiWidget")
|
||||
} else {
|
||||
tk.parent.children = append(tk.parent.children, tk)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue