(widget Widget)
| 119 | } |
| 120 | |
| 121 | func (ttep *ToolTipErrorPresenter) track(widget Widget) { |
| 122 | var wnd Window |
| 123 | |
| 124 | wnd = widget |
| 125 | |
| 126 | for wnd != nil { |
| 127 | handle := wnd.AsWindowBase().boundsChangedPublisher.event.Attach(func() { |
| 128 | ttep.toolTip.track(widget) |
| 129 | }) |
| 130 | |
| 131 | ttep.trackedBoundsChangedHandles[wnd] = handle |
| 132 | |
| 133 | if ttep.form == nil { |
| 134 | ttep.form = widget.Form() |
| 135 | ttep.formActivatingHandle = ttep.form.AsFormBase().activatingPublisher.event.Attach(func() { |
| 136 | ttep.toolTip.track(widget) |
| 137 | }) |
| 138 | ttep.formDeactivatingHandle = ttep.form.AsFormBase().deactivatingPublisher.event.Attach(func() { |
| 139 | ttep.toolTip.track(widget) |
| 140 | }) |
| 141 | } |
| 142 | |
| 143 | if w, ok := wnd.(Widget); ok { |
| 144 | if parent := w.Parent(); parent != nil { |
| 145 | wnd = parent |
| 146 | } |
| 147 | } else { |
| 148 | break |
| 149 | } |
| 150 | } |
| 151 | |
| 152 | ttep.toolTip.track(widget) |
| 153 | |
| 154 | ttep.curWidget = widget |
| 155 | } |
| 156 | |
| 157 | func (ttep *ToolTipErrorPresenter) untrack() { |
| 158 | if ttep.curWidget == nil { |
no test coverage detected