button

package
v0.0.0-...-e7ac65d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 1, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ImageButtonTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "ImageButton"}

The XML name of the element

View Source
var TextButtonTypeName = xml.Name{Space: "http://github.com/bhollier/ui/api/schema", Local: "TextButton"}

The XML name of the element

Functions

func NewImageButton

func NewImageButton(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element

Function to create a new image button

func NewTextButton

func NewTextButton(fs http.FileSystem, name xml.Name, parent element.Layout) element.Element

Function to create a new text button

Types

type ImageButton

type ImageButton struct {
	// An image button is a button
	element.ButtonImpl

	// It has an image
	element.ImageImpl
}

Element type for an image button

func (*ImageButton) Draw

func (e *ImageButton) Draw()

Function to draw the element

func (*ImageButton) Init

func (e *ImageButton) Init(window *pixelgl.Window, bounds *pixel.Rect) error

Function to initialise the element

func (*ImageButton) IsInitialised

func (e *ImageButton) IsInitialised() bool

Function to determine whether the element is initialised

func (*ImageButton) NewEvent

func (e *ImageButton) NewEvent(window *pixelgl.Window)

Function that is called when there is a new event

func (*ImageButton) Reset

func (e *ImageButton) Reset()

Function to reset the element

func (*ImageButton) UnmarshalXML

func (e *ImageButton) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal

type TextButton

type TextButton struct {
	// A text button is a button
	element.ButtonImpl

	// It has text
	element.TextImpl
}

Element type for a text button

func (*TextButton) Draw

func (e *TextButton) Draw()

Function to draw the element

func (*TextButton) Init

func (e *TextButton) Init(window *pixelgl.Window, bounds *pixel.Rect) error

Function to initialise the element

func (*TextButton) IsInitialised

func (e *TextButton) IsInitialised() bool

Function to determine whether the element is initialised

func (*TextButton) NewEvent

func (e *TextButton) NewEvent(window *pixelgl.Window)

Function that is called when there is a new event

func (*TextButton) Reset

func (e *TextButton) Reset()

Function to reset the element

func (*TextButton) UnmarshalXML

func (e *TextButton) UnmarshalXML(d *xml.Decoder, start xml.StartElement) (err error)

Function to unmarshal an XML element into an element. This function is usually only called by xml.Unmarshal

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL