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

Method RowFirstVisWidget

tensor/tensorcore/table.go:533–551  ·  view source on GitHub ↗

RowFirstVisWidget returns the first visible widget for given row (could be index or not) -- false if out of range

(row int)

Source from the content-addressed store, hash-verified

531// RowFirstVisWidget returns the first visible widget for given row (could be
532// index or not) -- false if out of range
533func (tb *Table) RowFirstVisWidget(row int) (*core.WidgetBase, bool) {
534 if !tb.IsRowInBounds(row) {
535 return nil, false
536 }
537 nWidgPerRow, idxOff := tb.RowWidgetNs()
538 lg := tb.ListGrid
539 w := lg.Children[row*nWidgPerRow].(core.Widget).AsWidget()
540 if w.Geom.TotalBBox != (image.Rectangle{}) {
541 return w, true
542 }
543 ridx := nWidgPerRow * row
544 for fli := 0; fli < tb.NCols; fli++ {
545 w := lg.Child(ridx + idxOff + fli).(core.Widget).AsWidget()
546 if w.Geom.TotalBBox != (image.Rectangle{}) {
547 return w, true
548 }
549 }
550 return nil, false
551}
552
553// RowGrabFocus grabs the focus for the first focusable widget in given row --
554// returns that element or nil if not successful -- note: grid must have

Callers

nothing calls this directly

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 4

RowWidgetNsMethod · 0.95
IsRowInBoundsMethod · 0.80
ChildMethod · 0.80
AsWidgetMethod · 0.65

Tested by

no test coverage detected