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

Method IsVisible

core/widget.go:385–393  ·  view source on GitHub ↗

IsVisible returns true if a widget is visible for rendering according to the [states.Invisible] flag on it or any of its parents. This flag is also set by [styles.DisplayNone] during [WidgetBase.Style]. This does *not* check for an empty TotalBBox, indicating that the widget is out of render range;

()

Source from the content-addressed store, hash-verified

383// window events.
384// This call recursively calls the parent, which is typically a short path.
385func (wb *WidgetBase) IsVisible() bool {
386 if wb == nil || wb.This == nil || wb.StateIs(states.Invisible) || wb.Scene == nil {
387 return false
388 }
389 if wb.Parent == nil {
390 return true
391 }
392 return wb.parentWidget().IsVisible()
393}
394
395// DirectRenderImage uploads image directly into given system.Drawer at given index
396// Typically this is a drw.SetGoImage call with an [image.RGBA], or

Callers 1

PushBoundsMethod · 0.95

Calls 3

StateIsMethod · 0.95
parentWidgetMethod · 0.95
IsVisibleMethod · 0.65

Tested by

no test coverage detected