MCPcopy Index your code
hub / github.com/lxn/walk / SetVisible

Method SetVisible

window.go:1344–1368  ·  view source on GitHub ↗

SetVisible sets if the *WindowBase is visible.

(visible bool)

Source from the content-addressed store, hash-verified

1342
1343// SetVisible sets if the *WindowBase is visible.
1344func (wb *WindowBase) SetVisible(visible bool) {
1345 old := wb.Visible()
1346
1347 setWindowVisible(wb.hWnd, visible)
1348
1349 wb.visible = visible
1350
1351 walkDescendants(wb.window, func(w Window) bool {
1352 w.AsWindowBase().visibleChangedPublisher.Publish()
1353
1354 return true
1355 })
1356
1357 if visible == old {
1358 return
1359 }
1360
1361 if widget, ok := wb.window.(Widget); ok {
1362 wb := widget.AsWidgetBase()
1363 wb.invalidateBorderInParent()
1364 wb.RequestLayout()
1365 }
1366
1367 wb.visibleChangedPublisher.Publish()
1368}
1369
1370// VisibleChanged returns an Event that you can attach to for handling
1371// visible changed events for the Window.

Callers

nothing calls this directly

Calls 8

VisibleMethod · 0.95
RequestLayoutMethod · 0.95
setWindowVisibleFunction · 0.85
walkDescendantsFunction · 0.85
AsWindowBaseMethod · 0.65
AsWidgetBaseMethod · 0.65
PublishMethod · 0.45

Tested by

no test coverage detected