Documentation ¶
Index ¶
- Constants
- type Area
- type AreaShape
- type BR
- type Base
- type Binding
- type BodyElement
- type Button
- type Canvas
- type Coordinates
- type Div
- type Element
- type Elements
- type HeadElement
- type Header
- type HeaderLevel
- type Image
- func (i *Image) AddMapArea(shape AreaShape, coords Coordinates, alt string, linkType LinkType, ...) error
- func (i *Image) Bindings() *Binding
- func (i *Image) Children() *Elements
- func (i *Image) Class() string
- func (i *Image) Clickable() bool
- func (i *Image) Load(img *image.RGBA) error
- func (i *Image) String() string
- type InputElement
- type InputEventType
- type InputType
- type LinkType
- type Map
- type OptionElement
- type OptionSlice
- type ScriptElement
- type SelectElement
- type Span
- type StyleSheet
- type Styles
- type TextElement
- type TitleElement
- type Window
Constants ¶
const ( //H1 header H1 = HeaderLevel(1) //H2 header H2 = HeaderLevel(2) //H3 header H3 = HeaderLevel(3) //H4 header H4 = HeaderLevel(4) )
const ( ButtonInput = InputType("button") CheckboxInput = InputType("checkbox") ColorInput = InputType("color") DateInput = InputType("date") DatetimeLocalInput = InputType("datetime-local") EmailInput = InputType("email") FileInput = InputType("file") HiddenInput = InputType("hidden") ImageInput = InputType("image") MonthInput = InputType("month") NumberInput = InputType("number") PasswordInput = InputType("password") RadioInput = InputType("radio") RangeInput = InputType("range") ResetInput = InputType("reset") SearchInput = InputType("search") SubmitInput = InputType("submit") TelInput = InputType("tel") TextInput = InputType("text") TimeInput = InputType("time") URLInput = InputType("url") WeekInput = InputType("week") OnBlur = InputEventType("onblur") OnChange = InputEventType("onchange") OnFocus = InputEventType("onfocus") OnInput = InputEventType("oninput") OnInvalid = InputEventType("oninvalid") OnReset = InputEventType("onreset") OnSearch = InputEventType("onsearch") OnSelect = InputEventType("onselect") OnSubmit = InputEventType("onsubmit") )
const ( //Default covers the whole area Default = AreaShape("default") // Rectangle Map Rectangle = AreaShape("rect") //Circle is a circular Map Circle = AreaShape("circle") //Polygon is a polygon Polygon = AreaShape("poly") //Function is a function link type Function = LinkType("function") //URL is an HREF link type URL = LinkType("url") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Area ¶
type Area struct { Shape AreaShape Coords Coordinates Alt string URL string LinkType LinkType }
Area is a component of a Map
type Base ¶
Base is the common structure that all Elements have
func (*Base) Disable ¶
func (b *Base) Disable()
Disable sets the base element disabledproperty to true
func (*Base) Enable ¶
func (b *Base) Enable()
Enable sets the base element disabled property to false
type Binding ¶
type Binding struct { FunctionName string BoundFunction func() }
Binding defines which JavaScript functions should be bound to Go functions
type BodyElement ¶
BodyElement for holding the body of the page
func NewBodyElement ¶
func NewBodyElement(onLoad string) *BodyElement
NewBodyElement creates a body element
func (*BodyElement) Bindings ¶
func (b *BodyElement) Bindings() *Binding
Bindings returns the Binding
func (*BodyElement) Children ¶
func (b *BodyElement) Children() *Elements
Children return the Elements
func (*BodyElement) String ¶
func (b *BodyElement) String() string
type Button ¶
Button type
func (*Button) BindFunction ¶
func (b *Button) BindFunction(f func())
BindFunction will bind the button to this go function
type Canvas ¶
Canvas element
type Coordinates ¶
type Coordinates []int
Coordinates is an array of coordinates
func (Coordinates) String ¶
func (c Coordinates) String() string
String representation of coordinates
type Element ¶
type Element interface { String() string Class() string Name() string Clickable() bool Styles() Styles Children() *Elements Bindings() *Binding Value() string SetUI(*lorca.UI) GetUI() *lorca.UI }
Element is an interface for describing an HTML element
type Elements ¶
type Elements struct {
// contains filtered or unexported fields
}
Elements is a slice of Elements
func (*Elements) AddElement ¶
AddElement appends an element to the slice of elements
type HeadElement ¶
HeadElement provides the Head
func NewHeadElement ¶
func NewHeadElement() *HeadElement
NewHeadElement to create a new Head Element
func (*HeadElement) Children ¶
func (h *HeadElement) Children() *Elements
Children returns the Elements
type Header ¶
type Header struct { StyleName string ID string Level HeaderLevel Text string Element }
Header is a header
func NewHeader ¶
func NewHeader(level HeaderLevel, name, text string) *Header
NewHeader produces a new header element
type Image ¶
Image element
func (*Image) AddMapArea ¶
func (i *Image) AddMapArea(shape AreaShape, coords Coordinates, alt string, linkType LinkType, link string) error
AddMapArea to the image map
type InputElement ¶
type InputElement struct { InputType Text string Base Binding InputEventType }
InputElement is for inputting values
func NewInputElement ¶
func NewInputElement(name string, inputType InputType) *InputElement
NewInputElement creates an input element
func (*InputElement) Bindings ¶
func (tf *InputElement) Bindings() *Binding
Bindings returns the element Bindings
func (*InputElement) Children ¶
func (tf *InputElement) Children() *Elements
Children returns the child elements
func (*InputElement) String ¶
func (tf *InputElement) String() string
type OptionElement ¶
OptionElement for use in SelectElement
func (*OptionElement) String ¶
func (oe *OptionElement) String() string
type OptionSlice ¶
type OptionSlice []*OptionElement
OptionSlice is a slice of OptionElements
func (*OptionSlice) String ¶
func (oes *OptionSlice) String() string
type ScriptElement ¶
ScriptElement is for scripts
func (*ScriptElement) Children ¶
func (scr *ScriptElement) Children() *Elements
Children returns an empty Elements
func (*ScriptElement) String ¶
func (scr *ScriptElement) String() string
type SelectElement ¶
type SelectElement struct { Base Binding InputEventType Options *OptionSlice }
SelectElement provides a selection drop-down
func NewSelectElement ¶
func NewSelectElement(name, functionName string) *SelectElement
NewSelectElement creates a new select element
func (*SelectElement) AddOption ¶
func (se *SelectElement) AddOption(label, value string)
AddOption will add an option to the SelectElement
func (*SelectElement) Bindings ¶
func (se *SelectElement) Bindings() *Binding
Bindings returns the Binding
func (*SelectElement) Children ¶
func (se *SelectElement) Children() *Elements
Children returns an empty list
func (*SelectElement) String ¶
func (se *SelectElement) String() string
type StyleSheet ¶
type StyleSheet struct {
URL string
}
StyleSheet references an external stylesheet to load
type TextElement ¶
type TextElement struct { Base // contains filtered or unexported fields }
TextElement is an element for plain old text - if you want style, use a Span
func (*TextElement) Children ¶
func (t *TextElement) Children() *Elements
Children returns an empty Elements
type TitleElement ¶
TitleElement for createing window titles
func (*TitleElement) Children ¶
func (t *TitleElement) Children() *Elements
Children will return an empty Elements
type Window ¶
type Window struct {
Width, Height int
Style StyleSheet
ProfileDir string
Elements *Elements
Args []string
Bindings []Binding
// contains filtered or unexported fields
}
Window is the main application window
func (*Window) BindChildren ¶
BindChildren is used to recursively