Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DriverInitializationError ¶
type DriverInitializationError struct {
// contains filtered or unexported fields
}
DriverInitializationError is returned when the
func (DriverInitializationError) Error ¶
func (d DriverInitializationError) Error() string
Error returns a string with the description of the error
type NoMatchingDriverError ¶
type NoMatchingDriverError struct {
// contains filtered or unexported fields
}
NoMatchingDriverError is returned when New could not find a driver matching the name
func (NoMatchingDriverError) Error ¶
func (n NoMatchingDriverError) Error() string
Error returns a string with the description of the error
type UI ¶
type UI struct {
// contains filtered or unexported fields
}
UI offers functionality to write UIs in Go.
func (*UI) NewWindow ¶
func (ui *UI) NewWindow(cf ...WindowConfig) *Window
NewWindow creates a new window for the UI.
type View ¶
type View interface { // Dirty signals the window that this view is dirty and should be repainted. Dirty() bool // Render renders the view into an image, if the view has not been resized, this will reuse the image. Render(drivers.Surface) // Event received events from the window, so the view can react to them. Event(events.Event) }
View is the abstraction of a thing(tm) that can render in a window and can reveive events from a window.
type Window ¶
type Window struct { OnResize func() OnMove func() OnKeyDown func(events.KeyEvent) // contains filtered or unexported fields }
Window holds the information of a window that is displayed on the screen.
type WindowConfig ¶
type WindowConfig func(*windowConfig)
WindowConfig represents a configuration function that sets specific properties for the window.
func WithParentWindow ¶
func WithParentWindow(w *Window) WindowConfig
WithParentWindow sets a parent window for a new window.
func WithType ¶
func WithType(t WindowType) WindowConfig
WithType sets the window type for a new window.
type WindowType ¶
type WindowType byte
WindowType indiates the type of the window, this can be used to create borderless windows.
const ( // NormalWindow indicates that the window has normal window decorations, this is used for most main windows. NormalWindow WindowType = iota // DialogWindow indicates that the window is a dialog, like a message box. DialogWindow // SplashWindow indicates a borderless window that is often displayed while the main application is loading. SplashWindow // MenuWindow indicates that the window is a tooltip or pop-up menu. MenuWindow )