absolute

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2017 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package absolute implements a fixed layout system similar to HTML absolute positioning. It does not support animations or flexible sizing. For more complex layouts, see the constraint package.

 l := &absolute.Layouter{
	Guide: layout.Guide{Frame: layout.Rt(0, 0, 100, 100)}
 }

 childView := NewChildView(...)
 l.Add(childView, layout.Guide{Frame: layout.Rt(10, 10, 90, 90)})

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Layouter

type Layouter struct {
	// Layout guide for the view.
	Guide layout.Guide
	// contains filtered or unexported fields
}

func (*Layouter) Add

func (l *Layouter) Add(v view.View, g layout.Guide)

Add adds v to the layouter and positions it with g.

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.

Jump to

Keyboard shortcuts

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