Documentation ¶
Index ¶
- Constants
- func Use(name string) error
- type Application
- type BasicContainer
- type BasicWidget
- type Container
- type Drawer
- type Widget
- type Window
- func (w *Window) Add(widget Widget)
- func (w *Window) Children() []Widget
- func (w *Window) Close()
- func (w *Window) Draw(drawer Drawer)
- func (w *Window) Height() int
- func (w *Window) OnClose(callback func(window *Window))
- func (w *Window) OnResize(callback func(window *Window, width, height int))
- func (w *Window) Parent() Container
- func (w *Window) Remove(widget Widget)
- func (w *Window) SetHeight(height int)
- func (w *Window) SetVisibility(visibility bool)
- func (w *Window) SetWidth(width int)
- func (w *Window) Width() int
Constants ¶
const DefaltEnvironmentName = ixgb.BackendName
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
Application holds the windows
func NewApplication ¶
func NewApplication() *Application
NewApplication creates a new application with default environment as backend.
func NewApplicationWithEnvironment ¶
func NewApplicationWithEnvironment(env backend.Environment) *Application
NewApplicationWithEnvironment creates a new application with given environment as backend.
func (*Application) AddWindow ¶
func (app *Application) AddWindow(w *Window)
type BasicContainer ¶
type BasicContainer struct { BasicWidget // contains filtered or unexported fields }
BasicContainer is an basic implementation of Container.
func (*BasicContainer) Add ¶
func (container *BasicContainer) Add(widget Widget)
Add widget as child.
func (*BasicContainer) Children ¶
func (container *BasicContainer) Children() []Widget
Children returns the children.
func (*BasicContainer) Remove ¶
func (container *BasicContainer) Remove(widget Widget)
Remove the given box from container if has it
type BasicWidget ¶
type BasicWidget struct {
// contains filtered or unexported fields
}
BasicWidget is an basic implementation of Widget.
func (*BasicWidget) Draw ¶
func (widget *BasicWidget) Draw(drawer Drawer)
Draw the container into screen
func (*BasicWidget) Height ¶
func (widget *BasicWidget) Height() int
Height returns the height of container
func (*BasicWidget) Parent ¶
func (widget *BasicWidget) Parent() Container
Parent returns the box where container is inside.
func (*BasicWidget) SetHeight ¶
func (widget *BasicWidget) SetHeight(height int)
SetHeight set the height of container
func (*BasicWidget) SetWidth ¶
func (widget *BasicWidget) SetWidth(width int)
SetWidth set the width of container
func (*BasicWidget) Width ¶
func (widget *BasicWidget) Width() int
Width returns the width of container
type Widget ¶
type Widget interface { Parent() Container Height() int SetHeight(height int) Width() int SetWidth(width int) Draw(drawer Drawer) }
Widget is a component of GUI.
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window holds native-window handler