Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend interface { NewWindow(image.Rectangle) (MainWindow, error) NewBox() Box NewTextBox() TextBox NewCanvasBox() CanvasBox NewContainerBox() ContainerBox // Stop must unblock run. Run() error Stop() // Do performs a callback function in the main thread as soon as // possible. This method must be safe to call concurrently. Do(func()) }
func Initialize ¶
Initialize instantiates a backend. The first backend (sorted by priority) that does not throw an error when initialized is used. If no backend could be instantiated, this function returns an error. This function should be called only once.
type Box ¶
type Box interface { Object Bounds() image.Rectangle InnerBounds() image.Rectangle SetBounds(image.Rectangle) SetColor(color.Color) SetBorder(...Border) SetMinimumSize(int, int) SetPadding(Inset) SetDNDData(data.Data) SetDNDAccept(...data.Mime) SetFocused(bool) SetFocusable(bool) Focused() bool Modifiers(func()) input.Modifiers MousePosition(func()) image.Point OnFocusEnter(func()) event.Cookie OnFocusLeave(func()) event.Cookie OnDNDEnter(func()) event.Cookie OnDNDLeave(func()) event.Cookie OnDNDDrop(func(data.Data)) event.Cookie OnMouseEnter(func()) event.Cookie OnMouseLeave(func()) event.Cookie OnMouseMove(func()) event.Cookie OnMouseDown(func(input.Button)) event.Cookie OnMouseUp(func(input.Button)) event.Cookie OnScroll(func(deltaX, deltaY float64)) event.Cookie OnKeyDown(func(key input.Key, numberPad bool)) event.Cookie OnKeyUp(func(key input.Key, numberPad bool)) event.Cookie ContentBounds() image.Rectangle ScrollTo(image.Point) OnContentBoundsChange(func()) event.Cookie }
type CanvasBox ¶
func NewCanvasBox ¶
func NewCanvasBox() CanvasBox
type ContainerBox ¶
type ContainerBox interface { Box SetGap(Gap) Add(Object) Delete(Object) Insert(child Object, before Object) Clear() Length() int At(int) Object SetLayout(Layout) }
func NewContainerBox ¶
func NewContainerBox() ContainerBox
type Factory ¶
Factory is a function that attempts to instatiate a backend. If the instantiation process fails at any point, it must clean up all resources and return nil and an error explaining what happened.
type MainWindow ¶
func NewWindow ¶
func NewWindow(bounds image.Rectangle) MainWindow
type TextBox ¶
type TextBox interface { Box SetTextColor(color.Color) SetFace(font.Face) SetHAlign(Align) SetVAlign(Align) }
func NewTextBox ¶
func NewTextBox() TextBox
type Window ¶
type Window interface { SetRoot(Object) SetTitle(string) SetIcon(sizes []image.Image) NewMenu(image.Rectangle) (Window, error) NewModal(image.Rectangle) (Window, error) Widget() (Window, error) Copy(data.Data) Paste(callback func(data.Data, error), accept ...data.Mime) Show() Hide() Close() OnClose(func()) event.Cookie }
Directories ¶
Path | Synopsis |
---|---|
Canvas defines a standard interface for images that support drawing primitives.
|
Canvas defines a standard interface for images that support drawing primitives. |
Package data provides operations to deal with arbitrary data and MIME types.
|
Package data provides operations to deal with arbitrary data and MIME types. |
Package event provides a system for broadcasting events to multiple event handlers.
|
Package event provides a system for broadcasting events to multiple event handlers. |
Package input defines keyboard and mouse code constants.
|
Package input defines keyboard and mouse code constants. |
Click to show internal directories.
Click to hide internal directories.