MCPcopy
hub / github.com/lxn/walk / track

Method track

tooltiperrorpresenter.go:121–155  ·  view source on GitHub ↗
(widget Widget)

Source from the content-addressed store, hash-verified

119}
120
121func (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
157func (ttep *ToolTipErrorPresenter) untrack() {
158 if ttep.curWidget == nil {

Callers 1

PresentErrorMethod · 0.95

Calls 5

AsWindowBaseMethod · 0.95
FormMethod · 0.65
AsFormBaseMethod · 0.65
ParentMethod · 0.65
AttachMethod · 0.45

Tested by

no test coverage detected