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

Method setName

core/renderwindow.go:178–199  ·  view source on GitHub ↗

setName sets name of this window and also the RenderWindow, and applies any window geometry settings associated with the new name if it is different from before

(name string)

Source from the content-addressed store, hash-verified

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
178func (w *renderWindow) setName(name string) {
179 curnm := w.name
180 isdif := curnm != name
181 w.name = name
182 if w.SystemWindow != nil {
183 w.SystemWindow.SetName(name)
184 }
185 if isdif && w.SystemWindow != nil {
186 wgp := theWindowGeometrySaver.pref(w.title, w.SystemWindow.Screen())
187 if wgp != nil {
188 theWindowGeometrySaver.settingStart()
189 if w.SystemWindow.Size() != wgp.size() || w.SystemWindow.Position() != wgp.pos() {
190 if DebugSettings.WinGeomTrace {
191 log.Printf("WindowGeometry: SetName setting geom for window: %v pos: %v size: %v\n", w.name, wgp.pos(), wgp.size())
192 }
193 w.SystemWindow.SetGeom(wgp.pos(), wgp.size())
194 system.TheApp.SendEmptyEvent()
195 }
196 theWindowGeometrySaver.settingEnd()
197 }
198 }
199}
200
201// setTitle sets title of this window and its underlying SystemWin.
202func (w *renderWindow) setTitle(title string) {

Callers 1

SetTitleMethod · 0.80

Calls 12

prefMethod · 0.80
settingStartMethod · 0.80
posMethod · 0.80
settingEndMethod · 0.80
SetNameMethod · 0.65
ScreenMethod · 0.65
SizeMethod · 0.65
sizeMethod · 0.65
PositionMethod · 0.65
SetGeomMethod · 0.65
SendEmptyEventMethod · 0.65
PrintfMethod · 0.45

Tested by

no test coverage detected