RunSynchronized runs all of the function calls queued by Synchronize and applies any layout changes queued by synchronizeLayout. RunSynchronized must be called by the group's thread.
()
| 216 | // |
| 217 | // RunSynchronized must be called by the group's thread. |
| 218 | func (g *WindowGroup) RunSynchronized() { |
| 219 | // Clear the list of callbacks first to avoid deadlock |
| 220 | // if a callback itself calls Synchronize()... |
| 221 | g.syncMutex.Lock() |
| 222 | funcs := g.syncFuncs |
| 223 | var results []*formLayoutResult |
| 224 | for _, result := range g.layoutResultsByForm { |
| 225 | results = append(results, result) |
| 226 | delete(g.layoutResultsByForm, result.form) |
| 227 | } |
| 228 | g.syncFuncs = nil |
| 229 | g.syncMutex.Unlock() |
| 230 | |
| 231 | for _, result := range results { |
| 232 | applyLayoutResults(result.results, result.stopwatch) |
| 233 | } |
| 234 | for _, f := range funcs { |
| 235 | f() |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | // ToolTip returns the tool tip control for the group, if one exists. |
| 240 | func (g *WindowGroup) ToolTip() *ToolTip { |
no test coverage detected