gui

package
v3.0.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2013 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Doc

type Doc struct {
	// contains filtered or unexported fields
}

gui.Doc serves a GUI as a html document.

func NewDoc

func NewDoc(htmlTemplate string, data interface{}) *Doc

func (*Doc) KeepAlive

func (d *Doc) KeepAlive() time.Time

func (*Doc) OnEvent

func (d *Doc) OnEvent(id string, f func())

func (*Doc) OnRefresh

func (d *Doc) OnRefresh(f func())

func (*Doc) ServeHTTP

func (d *Doc) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

func (*Doc) SetValue

func (d *Doc) SetValue(id string, v interface{})

func (*Doc) Value

func (d *Doc) Value(id string) interface{}

type Templ

type Templ Doc

Provides methods to the html template code passed to NewDoc.

func (*Templ) BeginSelect

func (t *Templ) BeginSelect(id string) string

func (*Templ) Button

func (t *Templ) Button(id string, value ...string) string

{{.Button id value}} adds a button to the document. value is text on the button.

func (*Templ) CheckBox

func (t *Templ) CheckBox(id, text string, value bool) string

{{.CheckBox id text value}} adds a checkbox to the document. text is displayed next to the textbox. value is true (checked) or false (unchecked)

func (*Templ) Data

func (t *Templ) Data() interface{}

func (*Templ) EndSelect

func (t *Templ) EndSelect() string

func (*Templ) ErrorBox

func (t *Templ) ErrorBox() string

{{.ErrorBox}} should be embedded in the template where errors are to be shown. CSS rules for class ErrorBox may be set, e.g., to render errors in red.

func (*Templ) Img

func (t *Templ) Img(id string, value string) string

{{.Img id url}} adds an image to the document.

func (*Templ) IntBox

func (t *Templ) IntBox(id string, value int) string

{{.IntBox id value}} adds a textbox for integer numbers to the document. value is the initial text in the box.

func (*Templ) JS

func (t *Templ) JS() string

{{.JS}} should always be embedded in the template <head>. Expands to needed JavaScript code.

func (*Templ) NumBox

func (t *Templ) NumBox(id string, value float64) string

{{.Numbox id value}} adds a textbox for numbers to the document. value is the initial text in the box.

func (*Templ) Option

func (t *Templ) Option(value string) string

func (*Templ) Range

func (t *Templ) Range(id string, min, max, value int) string

func (*Templ) Span

func (t *Templ) Span(id string, value ...string) string

{{.Span id value}} adds a piece of text ("label") to the document.

func (*Templ) TextBox

func (t *Templ) TextBox(id string, value string) string

{{.Textbox id value}} adds a textbox to the document. value is the initial text in the box.

Jump to

Keyboard shortcuts

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