gridblock

package
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2026 License: MIT Imports: 4 Imported by: 2 modules, 2 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EntityRef

func EntityRef(m *grid.Model) *entity.Ref

EntityRef returns the entity.Ref stored (as pointer or value) in the Ref of m's highlighted row, or nil when there is none.

func RefOf

func RefOf(v any) *entity.Ref

RefOf returns the entity.Ref held by v (a *entity.Ref or an entity.Ref, as found in grid.Row.Ref and grid.PinRowMsg.Ref), or nil for anything else, including a nil pointer.

Types

type Block

type Block struct{ *grid.Model }

Block adapts *grid.Model to transcript.Block, transcript.EntityBlock and transcript.SelfFramed. Model is embedded, so every other grid method (Title, CapturesEsc, SetSize, SetFocused, SelectRow, ...) is promoted unchanged, and View(width, focused) satisfies transcript.Block as is.

The grid's own messages (grid.PinRowMsg, grid.SelectionChangedMsg, ...) are returned untouched: what "pin" means is the composing layer's decision.

func Wrap

func Wrap(m *grid.Model) *Block

Wrap returns m as a transcript block.

func (*Block) Current

func (b *Block) Current() *entity.Ref

Current returns the entity under the cursor, or nil.

func (*Block) Focusable

func (b *Block) Focusable() bool

Focusable reports that a grid block always takes a focus stop.

func (*Block) SelfFramed

func (b *Block) SelfFramed() bool

SelfFramed reports that the grid draws its own complete border, so transcript must not wrap it in a card fill.

func (*Block) Update

func (b *Block) Update(msg tea.Msg) (transcript.Block, tea.Cmd)

Update forwards msg to the grid and returns the same Block (identity is kept).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL