Documentation ¶
Index ¶
- Variables
- type Background
- type Border
- type Box
- type BoxState
- type Frame
- func (this *Frame) BorderRect() image.Rectangle
- func (this *Frame) ContentRect() image.Rectangle
- func (this *Frame) Draw(img draw.Image)
- func (this Frame) Layout() Layout
- func (this *Frame) MouseEnteredEvent(where image.Point) bool
- func (this *Frame) MouseExitedEvent() bool
- func (this *Frame) MouseMoveEvent(where image.Point, from image.Point) bool
- func (this *Frame) Offset() image.Point
- func (this Frame) Parent() Widget
- func (this *Frame) SetBackground(state State, background *Background)
- func (this *Frame) SetBorderColor(state State, side Side, color c.Color)
- func (this *Frame) SetBorderWidth(state State, side Side, width int)
- func (this *Frame) SetMargin(state State, side Side, width int)
- func (this *Frame) SetPadding(state State, side Side, width int)
- func (this *Frame) State() State
- func (this *Frame) Update()
- type HorizontalLayout
- type Label
- type Layout
- type MainWindow
- type Margin
- type Padding
- type Side
- type Sides
- type Size
- func (this *Size) Height() int
- func (this *Size) HorizontalStretch() int
- func (this *Size) MaxHeight() int
- func (this *Size) MaxWidth() int
- func (this *Size) MinHeight() int
- func (this *Size) MinWidth() int
- func (this *Size) SetHeight(height int)
- func (this *Size) SetHorizontalStretch(stretch int)
- func (this *Size) SetMaxHeight(max int)
- func (this *Size) SetMaxWidth(max int)
- func (this *Size) SetMinHeight(min int)
- func (this *Size) SetMinWidth(min int)
- func (this *Size) SetVerticalStretch(stretch int)
- func (this *Size) SetWidth(width int)
- func (this *Size) VerticalStretch() int
- func (this *Size) Width() int
- type SizeI
- type State
- type Vertical
- func (this *Vertical) AddChild(child Widget)
- func (this *Vertical) ChildOffset(child Widget) image.Point
- func (this *Vertical) Children() []Widget
- func (this *Vertical) Draw(img draw.Image)
- func (this *Vertical) HorizontalStretch() int
- func (this *Vertical) Parent() Widget
- func (this *Vertical) Update()
- type Widget
Constants ¶
This section is empty.
Variables ¶
View Source
var FontPaths = []string{}
View Source
var FrameDefault = &Box{map[State]*BoxState{Normal: FrameDefaultNormalBoxState}}
View Source
var FrameDefaultBackground = Background{c.White}
View Source
var FrameDefaultBorder = Border{Sides{map[Side]int{All: 1}}, map[Side]c.Color{All: c.RGBA{255, 0, 0, 255}}}
View Source
var FrameDefaultMargin = Margin{Sides{map[Side]int{All: 25}}}
View Source
var FrameDefaultNormalBoxState = &BoxState{FrameDefaultBackground, FrameDefaultBorder, FrameDefaultMargin, FrameDefaultPadding}
View Source
var FrameDefaultPadding = Padding{Sides{map[Side]int{All: 5}}}
Functions ¶
This section is empty.
Types ¶
type Background ¶
func NewBackground ¶
func NewBackground(color c.Color) *Background
func (*Background) Draw ¶
func (this *Background) Draw(img draw.Image)
type BoxState ¶
type BoxState struct {
// contains filtered or unexported fields
}
func (*BoxState) BorderWidth ¶
type Frame ¶
func (*Frame) BorderRect ¶
func (*Frame) ContentRect ¶
func (*Frame) MouseExitedEvent ¶
func (*Frame) MouseMoveEvent ¶
func (*Frame) SetBackground ¶
func (this *Frame) SetBackground(state State, background *Background)
func (*Frame) SetBorderColor ¶
type HorizontalLayout ¶
type HorizontalLayout struct {
// contains filtered or unexported fields
}
type Label ¶
type Label struct { *Frame // contains filtered or unexported fields }
func NewLabelWithFunc ¶
type MainWindow ¶
type MainWindow struct { *Frame // contains filtered or unexported fields }
func NewMainWindow ¶
func NewMainWindow(width int, height int) *MainWindow
func (*MainWindow) Draw ¶
func (this *MainWindow) Draw(unused draw.Image)
func (*MainWindow) Update ¶
func (this *MainWindow) Update()
type Size ¶
type Size struct {
// contains filtered or unexported fields
}
func (*Size) HorizontalStretch ¶
func (*Size) SetHeight ¶
This function is called frequently by layouts and will likely change whatever value you use. In general, users should call Set{Max,Min}Height for the size to persist
func (*Size) SetHorizontalStretch ¶
func (*Size) SetMaxHeight ¶
func (*Size) SetMaxWidth ¶
func (*Size) SetMinHeight ¶
func (*Size) SetMinWidth ¶
func (*Size) SetVerticalStretch ¶
func (*Size) SetWidth ¶
This function is called frequently by layouts and will likely change whatever value you use. In general, users should call Set{Max,Min}Width for the size to persist
func (*Size) VerticalStretch ¶
type SizeI ¶
type SizeI interface { SetWidth(int) Width() int SetMaxWidth(int) MaxWidth() int SetMinWidth(int) MinWidth() int SetHorizontalStretch(int) HorizontalStretch() int SetHeight(int) Height() int SetMaxHeight(int) MaxHeight() int SetMinHeight(int) MinHeight() int SetVerticalStretch(int) VerticalStretch() int }
This interface is inherited by Widget
type Vertical ¶
type Vertical struct {
// contains filtered or unexported fields
}
func NewVertical ¶
func (*Vertical) HorizontalStretch ¶
type Widget ¶
type Widget interface { SizeI Parent() Widget Layout() Layout Offset() image.Point // Rectangle indicating content region ContentRect() image.Rectangle // Rectangle that includes the border and content regions BorderRect() image.Rectangle Update() Draw(draw.Image) MouseExitedEvent() bool MouseEnteredEvent(image.Point) bool MouseMoveEvent(where image.Point, from image.Point) bool }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.