Fix several segfaults
This commit is contained in:
parent
c3050e258f
commit
3e1a3ea5b9
@ -215,7 +215,7 @@ func (this *box) SetFocusable (focusable bool) {
|
||||
}
|
||||
|
||||
func (this *box) Focused () bool {
|
||||
hierarchy := this.parent.getHierarchy()
|
||||
hierarchy := this.getHierarchy()
|
||||
if hierarchy == nil { return false }
|
||||
return hierarchy.isFocused(this)
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ func (this *System) NewHierarchy (link WindowLink) *Hierarchy {
|
||||
hierarchy := &Hierarchy {
|
||||
system: this,
|
||||
link: link,
|
||||
needMinimum: make(util.Set[anyBox]),
|
||||
needLayout: make(util.Set[anyBox]),
|
||||
needDraw: make(util.Set[anyBox]),
|
||||
}
|
||||
return hierarchy
|
||||
}
|
||||
|
@ -164,8 +164,12 @@ func (this *Backend) newWindow (
|
||||
}
|
||||
|
||||
func (this *window) SetRoot (root tomo.Object) {
|
||||
if root == nil {
|
||||
this.hierarchy.SetRoot(nil)
|
||||
} else {
|
||||
this.hierarchy.SetRoot(root.GetBox())
|
||||
}
|
||||
}
|
||||
|
||||
func (this *window) SetTitle (title string) {
|
||||
this.title = title
|
||||
|
Loading…
Reference in New Issue
Block a user