MCPcopy Create free account
hub / github.com/cogentcore/core / RecycleMainWindow

Function RecycleMainWindow

core/renderwindow.go:161–174  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

159// If it finds it, it shows it and returns true. Otherwise, it returns false.
160// See [RecycleDialog] for a dialog version.
161func 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

Callers 3

EditorFunction · 0.92
SettingsWindowFunction · 0.85
InspectorWindowFunction · 0.85

Calls 3

findDataMethod · 0.80
RaiseMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected