RecycleMainWindow looks for an existing non-dialog window with the given Data. If it finds it, it shows it and returns true. Otherwise, it returns false. See [RecycleDialog] for a dialog version.
(data any)
| 159 | // If it finds it, it shows it and returns true. Otherwise, it returns false. |
| 160 | // See [RecycleDialog] for a dialog version. |
| 161 | func RecycleMainWindow(data any) bool { |
| 162 | if data == nil { |
| 163 | return false |
| 164 | } |
| 165 | ew, got := mainRenderWindows.findData(data) |
| 166 | if !got { |
| 167 | return false |
| 168 | } |
| 169 | if DebugSettings.WinEventTrace { |
| 170 | fmt.Printf("Win: %v getting recycled based on data match\n", ew.name) |
| 171 | } |
| 172 | ew.Raise() |
| 173 | return true |
| 174 | } |
| 175 | |
| 176 | // setName sets name of this window and also the RenderWindow, and applies any window |
| 177 | // geometry settings associated with the new name if it is different from before |
no test coverage detected