– import “”

Package table implements a vertical, single column layout system. Views are layed out from top to bottom.

l := &table.Layouter{}

childView := NewChildView(...)
l.Add(childView, nil) // The height of the view is determined by the child's layouter.

return view.Model{
    Views: l.Views(),

type Behavior

type Behavior interface {

TODO(KD): Behavior does nothing at the moment.

type Layouter

type Layouter struct {
	StartEdge layout.Edge // If no edges or more than one edge is specified layout.EdgeTop will be used.

func (*Layouter) Add

func (l *Layouter) Add(v view.View, b Behavior)

Add adds v to the layouter and positions it with g. Pass nil for the behavior.

func (*Layouter) Layout

func (l *Layouter) Layout(ctx layout.Context) (layout.Guide, []layout.Guide)

Layout implements the view.Layouter interface.

func (*Layouter) Notify

func (l *Layouter) Notify(f func()) comm.Id

Notify implements the view.Layouter interface.

func (*Layouter) Unnotify

func (l *Layouter) Unnotify(id comm.Id)

Unnotify implements the view.Layouter interface.

func (*Layouter) Views

func (l *Layouter) Views() []view.View

Views returns all views that have been added to l.