Fix several segfaults
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
@@ -50,8 +50,11 @@ type WindowLink interface {
|
||||
// NewHierarchy creates a new Hierarchy.
|
||||
func (this *System) NewHierarchy (link WindowLink) *Hierarchy {
|
||||
hierarchy := &Hierarchy {
|
||||
system: this,
|
||||
link: link,
|
||||
system: this,
|
||||
link: link,
|
||||
needMinimum: make(util.Set[anyBox]),
|
||||
needLayout: make(util.Set[anyBox]),
|
||||
needDraw: make(util.Set[anyBox]),
|
||||
}
|
||||
return hierarchy
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user