hgui: github.com/zozor/hgui Index | Files | Directories

package hgui

import "github.com/zozor/hgui"

hgui is a gui toolkit for webgui

Except for Style type, never, EVER use the widgets without initializing them, it probably won't work if you do that. All types that must be initialized has a New function (f.eks. NewFrame, NewButton...).

A simple gui toolkit to communicate between html/javascript and go server. On execution it opens a browser connecting it to the server.

Index

Package Files

hgui.go rs.go server.go webkit.go

Variables

var (
    Evt_onclick     = evtType("onclick")
    Evt_onabort     = evtType("onabort")
    Evt_onblur      = evtType("onblur")
    Evt_onchange    = evtType("onchange")
    Evt_ondblclick  = evtType("ondblclick")
    Evt_onerror     = evtType("onerror")
    Evt_onfocus     = evtType("onfocus")
    Evt_onkeydown   = evtType("onkeydown")
    Evt_onkeypress  = evtType("onkeypress")
    Evt_onkeyup     = evtType("onkeyup")
    Evt_onload      = evtType("onload")
    Evt_onmousedown = evtType("onmousedown")
    Evt_onmousemove = evtType("onmousemove")
    Evt_onmouseout  = evtType("onmouseout")
    Evt_onmouseover = evtType("onmouseover")
    Evt_onmouseup   = evtType("onmouseup")
    Evt_onreset     = evtType("onreset")
    Evt_onresize    = evtType("onresize")
    Evt_onselect    = evtType("onselect")
    Evt_onsubmit    = evtType("onsubmit")
    Evt_onunload    = evtType("onunload")
)
var (
    TextType_Password = texttype("password")
    TextType_Text     = texttype("text")
    TextType_Hidden   = texttype("hidden")
)
var (
    Css_bgcolor_black = Style{"background-color": "black"}
)
var DEBUG = false
var Topframe = &Frame{newWidget(), make([]HTMLer, 0, 20), true}

func Alert Uses

func Alert(s string)

Javascript alert

func Event Uses

func Event(js string, reply chan string) event

Makes an event that can be send to the browser

func NewOptions Uses

func NewOptions(values ...string) []*Option

func SendEvent Uses

func SendEvent(js string, reply chan string)

Sends and Event to the browser

func SetResource Uses

func SetResource(files map[string][]byte)

When you compile a file, be it image, or page or whatever, to a []byte, it can be used with this map. when the page is requested on the server, fx. /img/cat.jpg, it will write the bytes in

hgui.SetResource(map[string][]byte{"/img/cat.jpg", catpicvar})

back to the client.

func StartServer Uses

func StartServer(width, height int, title string)

This starts the server on the specified port. It also runs the mainloop for webkit. It also takes width and heigh + a title for the window to appear in.

type Button Uses

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

func NewButton Uses

func NewButton(value string, styles []Style, action func()) *Button

Creates a new button, with a caption and a callback

func (Button) AddStyle Uses

func (w Button) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Button) HTML Uses

func (b *Button) HTML() string

func (Button) Hide Uses

func (w Button) Hide()

Hides the widget

func (Button) ID Uses

func (w Button) ID() string

func (Button) RemoveAttribute Uses

func (w Button) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Button) RemoveStyle Uses

func (w Button) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Button) SetAttribute Uses

func (w Button) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Button) SetEvent Uses

func (w Button) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Button) SetStyle Uses

func (w Button) SetStyle(style Style)

Sets a style for a widget

func (Button) Show Uses

func (w Button) Show()

Shows the widget

func (Button) Style Uses

func (w Button) Style() Style

returns the style of a widget

type Cell Uses

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

func NewCell Uses

func NewCell(header bool, colspan, rowspan int, content HTMLer, styles ...Style) *Cell

Does this need introduction? Colspan tells the cell how many columns to span across, and rowspan how many rows..

func (Cell) AddStyle Uses

func (w Cell) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Cell) HTML Uses

func (t *Cell) HTML() (html string)

func (Cell) Hide Uses

func (w Cell) Hide()

Hides the widget

func (Cell) ID Uses

func (w Cell) ID() string

func (Cell) RemoveAttribute Uses

func (w Cell) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Cell) RemoveStyle Uses

func (w Cell) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Cell) SetAttribute Uses

func (w Cell) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Cell) SetEvent Uses

func (w Cell) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Cell) SetStyle Uses

func (w Cell) SetStyle(style Style)

Sets a style for a widget

func (Cell) Show Uses

func (w Cell) Show()

Shows the widget

func (Cell) Style Uses

func (w Cell) Style() Style

returns the style of a widget

type Fieldset Uses

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

func NewFieldset Uses

func NewFieldset(caption string, content HTMLer) *Fieldset

func (*Fieldset) HTML Uses

func (f *Fieldset) HTML() string

type Frame Uses

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

func NewFrame Uses

func NewFrame(styles ...Style) *Frame

Creates a new container for your widgets

func (*Frame) Add Uses

func (f *Frame) Add(widget ...HTMLer)

Add widget to your frame

func (Frame) AddStyle Uses

func (w Frame) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Frame) Flip Uses

func (f *Frame) Flip()

Resets the content of the frame. Events on widgets should be reassigned after using this. The function has it's usefulness, but should seldom be used.

func (*Frame) HTML Uses

func (f *Frame) HTML() string

func (Frame) Hide Uses

func (w Frame) Hide()

Hides the widget

func (Frame) ID Uses

func (w Frame) ID() string

func (Frame) RemoveAttribute Uses

func (w Frame) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Frame) RemoveStyle Uses

func (w Frame) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Frame) SetAttribute Uses

func (w Frame) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Frame) SetEvent Uses

func (w Frame) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Frame) SetStyle Uses

func (w Frame) SetStyle(style Style)

Sets a style for a widget

func (Frame) Show Uses

func (w Frame) Show()

Shows the widget

func (Frame) Style Uses

func (w Frame) Style() Style

returns the style of a widget

type Gauge Uses

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

func NewGauge Uses

func NewGauge(value, width int, color string) *Gauge

func (Gauge) AddStyle Uses

func (w Gauge) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Gauge) HTML Uses

func (g *Gauge) HTML() string

func (Gauge) Hide Uses

func (w Gauge) Hide()

Hides the widget

func (Gauge) ID Uses

func (w Gauge) ID() string

func (Gauge) RemoveAttribute Uses

func (w Gauge) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Gauge) RemoveStyle Uses

func (w Gauge) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Gauge) SetAttribute Uses

func (w Gauge) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Gauge) SetEvent Uses

func (w Gauge) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Gauge) SetStyle Uses

func (w Gauge) SetStyle(style Style)

Sets a style for a widget

func (*Gauge) SetValue Uses

func (g *Gauge) SetValue(pct int)

func (Gauge) Show Uses

func (w Gauge) Show()

Shows the widget

func (Gauge) Style Uses

func (w Gauge) Style() Style

returns the style of a widget

func (*Gauge) Value Uses

func (g *Gauge) Value() int

type HTMLer Uses

type HTMLer interface {
    HTML() string
}

func Html Uses

func Html(value string) HTMLer

type Image Uses

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

func NewImage Uses

func NewImage(src string, styles ...Style) *Image

New image...

func (Image) AddStyle Uses

func (w Image) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Image) HTML Uses

func (i *Image) HTML() string

func (Image) Hide Uses

func (w Image) Hide()

Hides the widget

func (Image) ID Uses

func (w Image) ID() string

func (Image) RemoveAttribute Uses

func (w Image) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Image) RemoveStyle Uses

func (w Image) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Image) SetAttribute Uses

func (w Image) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Image) SetEvent Uses

func (w Image) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Image) SetStyle Uses

func (w Image) SetStyle(style Style)

Sets a style for a widget

func (Image) Show Uses

func (w Image) Show()

Shows the widget

func (Image) Style Uses

func (w Image) Style() Style

returns the style of a widget

type Label Uses

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

func NewLabel Uses

func NewLabel(value string, styles ...Style) *Label

Creates a new label with a value

func (Label) AddStyle Uses

func (w Label) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Label) HTML Uses

func (l *Label) HTML() string

func (Label) Hide Uses

func (w Label) Hide()

Hides the widget

func (Label) ID Uses

func (w Label) ID() string

func (Label) RemoveAttribute Uses

func (w Label) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Label) RemoveStyle Uses

func (w Label) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Label) SetAttribute Uses

func (w Label) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Label) SetEvent Uses

func (w Label) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Label) SetStyle Uses

func (w Label) SetStyle(style Style)

Sets a style for a widget

func (*Label) SetValue Uses

func (l *Label) SetValue(s string)

Set the value of the Label

func (Label) Show Uses

func (w Label) Show()

Shows the widget

func (Label) Style Uses

func (w Label) Style() Style

returns the style of a widget

func (*Label) Value Uses

func (l *Label) Value() string

Gets the value of the label

type Link struct {
    // contains filtered or unexported fields
}
func NewLink(href string, value HTMLer, styles ...Style) *Link

func (Link) AddStyle Uses

func (w Link) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Link) HTML Uses

func (l *Link) HTML() string

func (Link) Hide Uses

func (w Link) Hide()

Hides the widget

func (Link) ID Uses

func (w Link) ID() string

func (Link) RemoveAttribute Uses

func (w Link) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Link) RemoveStyle Uses

func (w Link) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Link) SetAttribute Uses

func (w Link) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Link) SetEvent Uses

func (w Link) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Link) SetStyle Uses

func (w Link) SetStyle(style Style)

Sets a style for a widget

func (Link) Show Uses

func (w Link) Show()

Shows the widget

func (Link) Style Uses

func (w Link) Style() Style

returns the style of a widget

type List Uses

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

List are bullet points or numbered lists.

func NewList Uses

func NewList(ordered bool, styles []Style, items ...*Listitem) *List

func (List) AddStyle Uses

func (w List) AddStyle(n Style)

Adds a style to existing style on the widget

func (*List) HTML Uses

func (l *List) HTML() (html string)

func (List) Hide Uses

func (w List) Hide()

Hides the widget

func (List) ID Uses

func (w List) ID() string

func (List) RemoveAttribute Uses

func (w List) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (List) RemoveStyle Uses

func (w List) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (List) SetAttribute Uses

func (w List) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (List) SetEvent Uses

func (w List) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (*List) SetList Uses

func (l *List) SetList(items ...*Listitem)

func (List) SetStyle Uses

func (w List) SetStyle(style Style)

Sets a style for a widget

func (List) Show Uses

func (w List) Show()

Shows the widget

func (List) Style Uses

func (w List) Style() Style

returns the style of a widget

type Listitem Uses

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

func NewListItem Uses

func NewListItem(value string, styles ...Style) *Listitem

func (Listitem) AddStyle Uses

func (w Listitem) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Listitem) HTML Uses

func (l *Listitem) HTML() string

func (Listitem) Hide Uses

func (w Listitem) Hide()

Hides the widget

func (Listitem) ID Uses

func (w Listitem) ID() string

func (Listitem) RemoveAttribute Uses

func (w Listitem) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Listitem) RemoveStyle Uses

func (w Listitem) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Listitem) SetAttribute Uses

func (w Listitem) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Listitem) SetEvent Uses

func (w Listitem) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Listitem) SetStyle Uses

func (w Listitem) SetStyle(style Style)

Sets a style for a widget

func (Listitem) Show Uses

func (w Listitem) Show()

Shows the widget

func (Listitem) Style Uses

func (w Listitem) Style() Style

returns the style of a widget

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

func NewModal Uses

func NewModal(width, height int) *Modal

func (Modal) AddStyle Uses

func (w Modal) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Modal) HTML Uses

func (m *Modal) HTML() string

func (Modal) Hide Uses

func (w Modal) Hide()

Hides the widget

func (Modal) ID Uses

func (w Modal) ID() string

func (Modal) RemoveAttribute Uses

func (w Modal) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Modal) RemoveStyle Uses

func (w Modal) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Modal) SetAttribute Uses

func (w Modal) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (*Modal) SetContent Uses

func (m *Modal) SetContent(content HTMLer)

func (Modal) SetEvent Uses

func (w Modal) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Modal) SetStyle Uses

func (w Modal) SetStyle(style Style)

Sets a style for a widget

func (Modal) Show Uses

func (w Modal) Show()

Shows the widget

func (Modal) Style Uses

func (w Modal) Style() Style

returns the style of a widget

type Option Uses

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

func NewOption Uses

func NewOption(value, text string) *Option

func (Option) AddStyle Uses

func (w Option) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Option) HTML Uses

func (o *Option) HTML() string

func (Option) Hide Uses

func (w Option) Hide()

Hides the widget

func (Option) ID Uses

func (w Option) ID() string

func (Option) RemoveAttribute Uses

func (w Option) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Option) RemoveStyle Uses

func (w Option) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Option) SetAttribute Uses

func (w Option) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Option) SetEvent Uses

func (w Option) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Option) SetStyle Uses

func (w Option) SetStyle(style Style)

Sets a style for a widget

func (Option) Show Uses

func (w Option) Show()

Shows the widget

func (Option) Style Uses

func (w Option) Style() Style

returns the style of a widget

type Radiocheckbox Uses

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

func NewRadioCheckbox Uses

func NewRadioCheckbox(radiobox bool, group string, styles ...Style) *Radiocheckbox

Creates either new radiobox or checkbox. Checkboxes are not affected by the grouping

func (Radiocheckbox) AddStyle Uses

func (w Radiocheckbox) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Radiocheckbox) Check Uses

func (t *Radiocheckbox) Check()

Checks the checkbox/radiobox

func (*Radiocheckbox) Checked Uses

func (t *Radiocheckbox) Checked() bool

Get the state of a radiobox/checkbox

func (*Radiocheckbox) HTML Uses

func (t *Radiocheckbox) HTML() string

func (Radiocheckbox) Hide Uses

func (w Radiocheckbox) Hide()

Hides the widget

func (Radiocheckbox) ID Uses

func (w Radiocheckbox) ID() string

func (Radiocheckbox) RemoveAttribute Uses

func (w Radiocheckbox) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Radiocheckbox) RemoveStyle Uses

func (w Radiocheckbox) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Radiocheckbox) SetAttribute Uses

func (w Radiocheckbox) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Radiocheckbox) SetEvent Uses

func (w Radiocheckbox) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Radiocheckbox) SetStyle Uses

func (w Radiocheckbox) SetStyle(style Style)

Sets a style for a widget

func (Radiocheckbox) Show Uses

func (w Radiocheckbox) Show()

Shows the widget

func (Radiocheckbox) Style Uses

func (w Radiocheckbox) Style() Style

returns the style of a widget

func (*Radiocheckbox) Uncheck Uses

func (t *Radiocheckbox) Uncheck()

Unchecks the checkbox/radiobox

type Row Uses

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

you put this into your table/grid. It's a row.

func NewRow Uses

func NewRow(styles []Style, c ...*Cell) *Row

func (*Row) AddCells Uses

func (r *Row) AddCells(c ...*Cell)

func (Row) AddStyle Uses

func (w Row) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Row) HTML Uses

func (r *Row) HTML() (html string)

func (Row) Hide Uses

func (w Row) Hide()

Hides the widget

func (Row) ID Uses

func (w Row) ID() string

func (Row) RemoveAttribute Uses

func (w Row) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Row) RemoveStyle Uses

func (w Row) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Row) SetAttribute Uses

func (w Row) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Row) SetEvent Uses

func (w Row) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Row) SetStyle Uses

func (w Row) SetStyle(style Style)

Sets a style for a widget

func (Row) Show Uses

func (w Row) Show()

Shows the widget

func (Row) Style Uses

func (w Row) Style() Style

returns the style of a widget

type Selectform Uses

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

func NewSelect Uses

func NewSelect(size int, multiple bool, styles []Style, options ...*Option) *Selectform

Create new combobox, multiselection og list item.

func (Selectform) AddStyle Uses

func (w Selectform) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Selectform) HTML Uses

func (s *Selectform) HTML() (html string)

func (Selectform) Hide Uses

func (w Selectform) Hide()

Hides the widget

func (Selectform) ID Uses

func (w Selectform) ID() string

func (Selectform) RemoveAttribute Uses

func (w Selectform) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Selectform) RemoveStyle Uses

func (w Selectform) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (*Selectform) Selected Uses

func (s *Selectform) Selected() (string, []string)

func (Selectform) SetAttribute Uses

func (w Selectform) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Selectform) SetEvent Uses

func (w Selectform) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (*Selectform) SetOptions Uses

func (s *Selectform) SetOptions(o ...*Option)

func (Selectform) SetStyle Uses

func (w Selectform) SetStyle(style Style)

Sets a style for a widget

func (Selectform) Show Uses

func (w Selectform) Show()

Shows the widget

func (Selectform) Style Uses

func (w Selectform) Style() Style

returns the style of a widget

type Style Uses

type Style map[string]string

CSS map

func Css_bgcolor Uses

func Css_bgcolor(color string) Style

func UnmarshalStyle Uses

func UnmarshalStyle(style string) (Style, error)

Creates a Style type from a string

func (Style) AddStyle Uses

func (s Style) AddStyle(n Style)

Add more css to your style

func (Style) Marshal Uses

func (s Style) Marshal() string

func (Style) RemoveStyle Uses

func (s Style) RemoveStyle(n Style)

Remove some css from your style

type Table Uses

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

func NewTable Uses

func NewTable(styles []Style, r ...*Row) *Table

Creates a grid to put stuff into

func (Table) AddStyle Uses

func (w Table) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Table) Addrows Uses

func (t *Table) Addrows(r ...*Row)

func (*Table) HTML Uses

func (t *Table) HTML() (html string)

func (Table) Hide Uses

func (w Table) Hide()

Hides the widget

func (Table) ID Uses

func (w Table) ID() string

func (Table) RemoveAttribute Uses

func (w Table) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Table) RemoveStyle Uses

func (w Table) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Table) SetAttribute Uses

func (w Table) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Table) SetEvent Uses

func (w Table) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Table) SetStyle Uses

func (w Table) SetStyle(style Style)

Sets a style for a widget

func (Table) Show Uses

func (w Table) Show()

Shows the widget

func (Table) Style Uses

func (w Table) Style() Style

returns the style of a widget

type Textarea Uses

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

func NewTextarea Uses

func NewTextarea(value string, styles ...Style) *Textarea

Multiline text input

func (Textarea) AddStyle Uses

func (w Textarea) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Textarea) HTML Uses

func (t *Textarea) HTML() string

func (Textarea) Hide Uses

func (w Textarea) Hide()

Hides the widget

func (Textarea) ID Uses

func (w Textarea) ID() string

func (Textarea) RemoveAttribute Uses

func (w Textarea) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Textarea) RemoveStyle Uses

func (w Textarea) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Textarea) SetAttribute Uses

func (w Textarea) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Textarea) SetEvent Uses

func (w Textarea) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Textarea) SetStyle Uses

func (w Textarea) SetStyle(style Style)

Sets a style for a widget

func (*Textarea) SetValue Uses

func (t *Textarea) SetValue(s string)

func (Textarea) Show Uses

func (w Textarea) Show()

Shows the widget

func (Textarea) Style Uses

func (w Textarea) Style() Style

returns the style of a widget

func (*Textarea) Value Uses

func (t *Textarea) Value() string

type Textinput Uses

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

func NewTextinput Uses

func NewTextinput(value string, ttype texttype, styles ...Style) *Textinput

Creates a inpup field for text

func (Textinput) AddStyle Uses

func (w Textinput) AddStyle(n Style)

Adds a style to existing style on the widget

func (*Textinput) HTML Uses

func (t *Textinput) HTML() string

func (Textinput) Hide Uses

func (w Textinput) Hide()

Hides the widget

func (Textinput) ID Uses

func (w Textinput) ID() string

func (Textinput) RemoveAttribute Uses

func (w Textinput) RemoveAttribute(attr string)

Not everything can be removed, see $.removeAttr() in jquery for details The use of frame.Flip, removes everything made through this call. If used with flip, it should be called afterwards

func (Textinput) RemoveStyle Uses

func (w Textinput) RemoveStyle(n Style)

Removes a style from the widget, specified by the n style

func (Textinput) SetAttribute Uses

func (w Textinput) SetAttribute(attribute, value string)

This is set ONLY on the client side, the server does not record this. Don't set style with this

func (Textinput) SetEvent Uses

func (w Textinput) SetEvent(event evtType, action func())

This is set ONLY on the client side, the server does not record this. The use of frame.Flip, removes everything made through this call If used with flip, it should be called afterwards.

func (Textinput) SetStyle Uses

func (w Textinput) SetStyle(style Style)

Sets a style for a widget

func (*Textinput) SetValue Uses

func (t *Textinput) SetValue(s string)

Sets the value of the input

func (Textinput) Show Uses

func (w Textinput) Show()

Shows the widget

func (Textinput) Style Uses

func (w Textinput) Style() Style

returns the style of a widget

func (*Textinput) Value Uses

func (t *Textinput) Value() string

Grabs the value of the textinput

Directories

PathSynopsis
examples/anime
examples/demo
examples/simple

Package hgui imports 12 packages (graph) and is imported by 3 packages. Updated 2016-07-15. Refresh now. Tools for package owners.