SetVisible sets if the *WindowBase is visible.
(visible bool)
| 1342 | |
| 1343 | // SetVisible sets if the *WindowBase is visible. |
| 1344 | func (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. |
nothing calls this directly
no test coverage detected