Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterBackend ¶
func RegisterBackend(backend Backend)
Types ¶
type App ¶
type App interface {
Run() error
Close() error
CloseChan() <-chan struct{}
IsClosed() bool
Sync(f func())
Lock()
Unlock()
}
func CApp ¶
func CApp() App
CApp returns the current application. There is only one application at a time.
func NewApp ¶
func NewApp(f AppInitFunc) (App, error)
type AppInitFunc ¶
type AppInitFunc func() error
type Backend ¶
type Backend interface {
App() App
NewApp(f AppInitFunc) (App, error)
NewWindow(title string, width, height int) (Window, error)
NewRect() Rect
NewText() Text
}
Panic on methods without error return value.
type Color ¶
type MouseButton ¶
type MouseButton int
const ( MouseButtonLeft MouseButton = iota MouseButtonMiddle MouseButtonRight )
type MouseState ¶
type MouseState int
const ( MouseStatePressed MouseState = iota MouseStateReleased )
type Rect ¶
type Rect interface {
AddWidget(w Widget)
X() int
SetX(x int)
Y() int
SetY(y int)
Width() int
SetWidth(w int)
Height() int
SetHeight(h int)
Right() int
Bottom() int
Radius() int
SetRadius(r int)
Border() int
SetBorder(b int)
Color() Color
SetColor(c Color)
BorderColor() Color
SetBorderColor(c Color)
}
type Text ¶
type Text interface {
X() int
SetX(x int)
Y() int
SetY(y int)
Width() int
Height() int
Right() int
Bottom() int
Color() Color
SetColor(c Color)
Text() string
SetText(t string)
FontSize() int
SetFontSize(s int)
WrapLen() int
SetWrapLen(l int)
MouseHovered() bool
OnMouseMove(f func(x, y int))
OnMouseEnter(f func())
OnMouseLeave(f func())
OnMouseButton(f func(b MouseButton, s MouseState, x, y int))
}
Click to show internal directories.
Click to hide internal directories.