Documentation
¶
Overview ¶
wtk (widget toolkit) defines a model to declare a user interface without being explicit about the underlying technology. Using wtk, widget developers can use the same description to render graphical user interfaces across platforms, like web, mobile or desktop.
Index ¶
- Variables
- func Post(d time.Duration, f func())
- func Run(target View, init func())
- func ShowMessage(parent View, msg string)
- type AbsApplication
- type Alignment
- type Application
- type Button
- func (t *Button) AddClickListener(f func(v View)) *Button
- func (t *Button) AddIcon(icon icon.Icon, alignment Alignment) *Button
- func (b Button) Context() Context
- func (b Button) Release()
- func (b Button) Scope() context.Context
- func (t *Button) Self(ref **Button) *Button
- func (t *Button) SetEnabled(b bool) *Button
- func (t *Button) SetLeadingIcon(icon icon.Icon) *Button
- func (t *Button) SetStyleKind(s ButtonStyleKind) *Button
- func (t *Button) SetText(str string) *Button
- func (t *Button) Style(style ...Style) *Button
- type ButtonStyleKind
- type Card
- func (t *Card) AddViews(views ...View) *Card
- func (t *Card) AppendViews(views ...View) ViewGroup
- func (t *Card) ClearViews() ViewGroup
- func (b Card) Context() Context
- func (b Card) Release()
- func (t *Card) RemoveAll() *Card
- func (b Card) Scope() context.Context
- func (t *Card) Self(ref **Card) *Card
- func (t *Card) Style(style ...Style) *Card
- func (t *Card) StyleFor(criteria MediaCriteria, style ...Style) *Card
- type Checkbox
- func (t *Checkbox) AddChangeListener(f func(v *Checkbox)) *Checkbox
- func (t *Checkbox) Checked() bool
- func (b Checkbox) Context() Context
- func (t *Checkbox) Indeterminate() bool
- func (b Checkbox) Release()
- func (b Checkbox) Scope() context.Context
- func (t *Checkbox) Self(ref **Checkbox) *Checkbox
- func (t *Checkbox) SetChecked(b bool) *Checkbox
- func (t *Checkbox) SetEnabled(b bool) *Checkbox
- func (t *Checkbox) SetIndeterminate(b bool) *Checkbox
- func (t *Checkbox) SetText(s string) *Checkbox
- func (t *Checkbox) Style(style ...Style) *Checkbox
- type CircularProgress
- type Code
- type Color
- type Context
- type Dialog
- func (t *Dialog) AddAction(caption string, onClick func(dlg *Dialog)) *Dialog
- func (t *Dialog) Close()
- func (b Dialog) Context() Context
- func (b Dialog) Release()
- func (b Dialog) Scope() context.Context
- func (t *Dialog) Self(ref **Dialog) *Dialog
- func (t *Dialog) SetBody(v View) *Dialog
- func (t *Dialog) SetTitle(s string) *Dialog
- func (t *Dialog) Show(parent View)
- func (t *Dialog) Style(style ...Style) *Dialog
- type DisplayType
- type Drawer
- type ErrorView
- type FontStyle
- type Frame
- func (t *Frame) AppendViews(views ...View) ViewGroup
- func (t *Frame) ClearViews() ViewGroup
- func (b Frame) Context() Context
- func (b Frame) Release()
- func (t *Frame) RemoveAll() *Frame
- func (b Frame) Scope() context.Context
- func (t *Frame) Self(ref **Frame) *Frame
- func (t *Frame) SetView(v View) *Frame
- func (t *Frame) Style(style ...Style) *Frame
- type Grid
- func (t *Grid) AddView(view View, opt GridLayoutParams) *Grid
- func (t *Grid) AddViews(views ...View) *Grid
- func (t *Grid) AppendViews(views ...View) ViewGroup
- func (t *Grid) ClearViews() ViewGroup
- func (b Grid) Context() Context
- func (b Grid) Release()
- func (t *Grid) RemoveAll() *Grid
- func (b Grid) Scope() context.Context
- func (t *Grid) Self(ref **Grid) *Grid
- func (t *Grid) SetAreas(areas [][]string) *Grid
- func (t *Grid) SetColumnGap(scalar Scalar) *Grid
- func (t *Grid) SetColumnWidths(scalars ...Scalar) *Grid
- func (t *Grid) SetGap(scalar Scalar) *Grid
- func (t *Grid) SetHorizontalAlign(alignment GridAlign) *Grid
- func (t *Grid) SetRowGap(scalar Scalar) *Grid
- func (t *Grid) SetRowHeights(scalars ...Scalar) *Grid
- func (t *Grid) SetVerticalAlign(alignment GridAlign) *Grid
- func (t *Grid) Style(style ...Style) *Grid
- func (t *Grid) StyleFor(criteria MediaCriteria, style ...Style) *Grid
- type GridAlign
- type GridLayoutParams
- type Group
- func (t *Group) AddViews(views ...View) *Group
- func (t *Group) AppendViews(views ...View) ViewGroup
- func (t *Group) ClearViews() ViewGroup
- func (b Group) Context() Context
- func (b Group) Release()
- func (t *Group) RemoveAll() *Group
- func (b Group) Scope() context.Context
- func (t *Group) Self(ref **Group) *Group
- func (t *Group) Style(style ...Style) *Group
- func (t *Group) StyleFor(criteria MediaCriteria, style ...Style) *Group
- type HStack
- func (t *HStack) AddViews(views ...View) *HStack
- func (t *HStack) AppendViews(views ...View) ViewGroup
- func (t *HStack) ClearViews() ViewGroup
- func (b HStack) Context() Context
- func (b HStack) Release()
- func (t *HStack) RemoveAll() *HStack
- func (b HStack) Scope() context.Context
- func (t *HStack) Self(ref **HStack) *HStack
- func (t *HStack) Style(style ...Style) *HStack
- func (t *HStack) StyleFor(criteria MediaCriteria, style ...Style) *HStack
- type Handle
- type Highlighter
- type Icon
- type IconButton
- func (t *IconButton) AddClickListener(f func(v View)) *IconButton
- func (b IconButton) Context() Context
- func (b IconButton) Release()
- func (b IconButton) Scope() context.Context
- func (t *IconButton) Self(ref **IconButton) *IconButton
- func (t *IconButton) Set(str icon.Icon) *IconButton
- func (t *IconButton) SetChar(r rune) *IconButton
- func (t *IconButton) Style(style ...Style) *IconButton
- type IconItem
- type InputType
- type LinearProgress
- func (b LinearProgress) Context() Context
- func (b LinearProgress) Release()
- func (b LinearProgress) Scope() context.Context
- func (t *LinearProgress) Self(ref **LinearProgress) *LinearProgress
- func (t *LinearProgress) SetIndeterminate(b bool) *LinearProgress
- func (t *LinearProgress) SetProgress(f float64) *LinearProgress
- func (t *LinearProgress) SetSecondaryProgress(f float64) *LinearProgress
- func (t *LinearProgress) Style(style ...Style) *LinearProgress
- type Link
- func (b Link) Context() Context
- func (b Link) Release()
- func (b Link) Scope() context.Context
- func (t *Link) Self(ref **Link) *Link
- func (t *Link) SetCaption(str string) *Link
- func (t *Link) SetRef(r string) *Link
- func (t *Link) SetTarget(target LinkTarget) *Link
- func (t *Link) Style(style ...Style) *Link
- type LinkTarget
- type List
- func (t *List) AddItems(items ...LstItem) *List
- func (t *List) AddSelectListener(action func(idx int)) *List
- func (b List) Context() Context
- func (b List) Release()
- func (b List) Scope() context.Context
- func (t *List) SelectedIndex() int
- func (t *List) Self(ref **List) *List
- func (t *List) SetSelectedIndex(idx int) *List
- func (t *List) Style(style ...Style) *List
- type ListHeader
- type ListItem
- func (t *ListItem) AddClickListener(action func(v View)) *ListItem
- func (b ListItem) Context() Context
- func (b ListItem) Release()
- func (b ListItem) Scope() context.Context
- func (t *ListItem) SetLeadingView(v View) *ListItem
- func (t *ListItem) SetSelected(b bool) *ListItem
- func (t *ListItem) SetTrailingView(v View) *ListItem
- type ListSeparator
- type Listener
- type LstItem
- type MediaCriteria
- func MatchAll(criterias ...MediaCriteria) MediaCriteria
- func MatchLandscape() MediaCriteria
- func MatchMaxHeight(scalar Scalar) MediaCriteria
- func MatchMaxWidth(scalar Scalar) MediaCriteria
- func MatchMinHeight(scalar Scalar) MediaCriteria
- func MatchMinWidth(scalar Scalar) MediaCriteria
- func MatchOne(criterias ...MediaCriteria) MediaCriteria
- func MatchPortrait() MediaCriteria
- type MediaMatcher
- type Menu
- type MenuItem
- type Model
- type ModelChanged
- type NamedParameter
- type OverflowType
- type Picker
- func (t *Picker) BindText(s *string) *Picker
- func (b Picker) Context() Context
- func (t *Picker) Release()
- func (b Picker) Scope() context.Context
- func (t *Picker) Selected() int
- func (t *Picker) Self(ref **Picker) *Picker
- func (t *Picker) SetEnabled(b bool) *Picker
- func (t *Picker) SetHelper(str string) *Picker
- func (t *Picker) SetInvalid(b bool) *Picker
- func (t *Picker) SetLabel(str string) *Picker
- func (t *Picker) SetOptions(options ...string) *Picker
- func (t *Picker) SetSelectListener(f func(v *Picker)) *Picker
- func (t *Picker) SetSelected(idx int) *Picker
- func (t *Picker) SetText(str string) *Picker
- func (t *Picker) Style(style ...Style) *Picker
- func (t *Picker) Text() string
- func (t *Picker) TextProperty() property.String
- type PositionType
- type Query
- type Resource
- type Route
- type Router
- func (r *Router) AddRoute(path string, f func(Query)) *Router
- func (r *Router) Invalidate() error
- func (r *Router) Navigate(u *url.URL)
- func (r *Router) Release()
- func (r *Router) Reload(force bool)
- func (r *Router) Routes() []Route
- func (r *Router) SetUnhandledRouteAction(f func(Query)) *Router
- func (r *Router) Start()
- type Scalar
- type Snackbar
- func (t *Snackbar) Close() *Snackbar
- func (b Snackbar) Context() Context
- func (t *Snackbar) Release()
- func (b Snackbar) Scope() context.Context
- func (t *Snackbar) Self(ref **Snackbar) *Snackbar
- func (t *Snackbar) SetAction(action func(v View)) *Snackbar
- func (t *Snackbar) SetActionLabel(str string) *Snackbar
- func (t *Snackbar) SetText(str string) *Snackbar
- func (t *Snackbar) SetTimeout(d time.Duration) *Snackbar
- func (t *Snackbar) Show(v View) *Snackbar
- func (t *Snackbar) Style(style ...Style) *Snackbar
- type Spacer
- type Style
- func BackgroundColor(color Color) Style
- func BorderRadius(scalar Scalar) Style
- func Display(displayType DisplayType) Style
- func Font(name FontStyle) Style
- func FontWeight(weight TypeWeight) Style
- func ForegroundColor(color Color) Style
- func Height(scalar Scalar) Style
- func Margin() Style
- func MarginBottom(scalar Scalar) Style
- func MarginLeft(scalar Scalar) Style
- func MarginRight(scalar Scalar) Style
- func MarginTop(scalar Scalar) Style
- func MaxWidth(scalar Scalar) Style
- func MinWidth(scalar Scalar) Style
- func Overflow(overflow OverflowType) Style
- func PadBottom(scalar Scalar) Style
- func PadLeft(scalar Scalar) Style
- func PadRight(scalar Scalar) Style
- func PadTop(scalar Scalar) Style
- func Padding() Style
- func Position(position PositionType) Style
- func Repel() Style
- func Width(scalar Scalar) Style
- type Tab
- type TabView
- func (b TabView) Context() Context
- func (t *TabView) Release()
- func (b TabView) Scope() context.Context
- func (t *TabView) Self(ref **TabView) *TabView
- func (t *TabView) SetActive(idx int) *TabView
- func (t *TabView) SetScrollable(b bool) *TabView
- func (t *TabView) SetTabs(tabs ...*Tab) *TabView
- func (t *TabView) Style(style ...Style) *TabView
- type Table
- func (t *Table) AddRow(columns ...View) *Table
- func (t *Table) Align(colIdx int, align Alignment) *Table
- func (b Table) Context() Context
- func (b Table) Release()
- func (t *Table) RowSelection() bool
- func (b Table) Scope() context.Context
- func (t *Table) Selected() []int
- func (t *Table) Self(ref **Table) *Table
- func (t *Table) SetHeader(columns ...View) *Table
- func (t *Table) SetRowClickListener(f func(v View, rowIdx int)) *Table
- func (t *Table) SetRowSelection(b bool) *Table
- func (t *Table) SetSelected(rows ...int) *Table
- func (t *Table) SetSelectionChangeListener(f func(t *Table)) *Table
- func (t *Table) Style(style ...Style) *Table
- type Text
- type TextArea
- func (b TextArea) Context() Context
- func (t *TextArea) InputStyle(styles ...Style) *TextArea
- func (b TextArea) Release()
- func (b TextArea) Scope() context.Context
- func (t *TextArea) Self(ref **TextArea) *TextArea
- func (t *TextArea) SetEnabled(b bool) *TextArea
- func (t *TextArea) SetHelper(str string) *TextArea
- func (t *TextArea) SetInvalid(b bool) *TextArea
- func (t *TextArea) SetLabel(str string) *TextArea
- func (t *TextArea) SetMaxLength(chars int) *TextArea
- func (t *TextArea) SetRequired(b bool) *TextArea
- func (t *TextArea) SetText(str string) *TextArea
- func (t *TextArea) Style(style ...Style) *TextArea
- type TextField
- func (t *TextField) AddClickListener(f func(v View)) *TextField
- func (t *TextField) AddFocusChangeListener(f func(v View, hasFocus bool)) *TextField
- func (t *TextField) AddKeyDownListener(f func(v View, keyCode int)) *TextField
- func (t *TextField) AddKeyUpListener(f func(v View, keyCode int)) *TextField
- func (t *TextField) AddLeadingIconClickListener(f func(v View)) *TextField
- func (t *TextField) AddTrailingIconClickListener(f func(v View)) *TextField
- func (t *TextField) BindInt(s *int) *TextField
- func (t *TextField) BindText(s *string) *TextField
- func (b TextField) Context() Context
- func (t *TextField) IntProperty() property.Int
- func (t *TextField) Release()
- func (b TextField) Scope() context.Context
- func (t *TextField) Self(ref **TextField) *TextField
- func (t *TextField) SetEnabled(b bool) *TextField
- func (t *TextField) SetHelper(str string) *TextField
- func (t *TextField) SetHelperPersistent(b bool) *TextField
- func (t *TextField) SetInputType(in InputType) *TextField
- func (t *TextField) SetInvalid(b bool) *TextField
- func (t *TextField) SetLabel(str string) *TextField
- func (t *TextField) SetLeadingIcon(ico icon.Icon) *TextField
- func (t *TextField) SetMaxLength(chars int) *TextField
- func (t *TextField) SetRange(min, max int) *TextField
- func (t *TextField) SetRequired(b bool) *TextField
- func (t *TextField) SetText(str string) *TextField
- func (t *TextField) SetTrailingIcon(ico icon.Icon) *TextField
- func (t *TextField) Style(style ...Style) *TextField
- func (t *TextField) Text() string
- func (t *TextField) TextProperty() property.String
- type ThemeController
- type TopAppBar
- func (t *TopAppBar) AddActions(items ...*IconItem) *TopAppBar
- func (b TopAppBar) Context() Context
- func (b TopAppBar) Release()
- func (b TopAppBar) Scope() context.Context
- func (t *TopAppBar) Self(ref **TopAppBar) *TopAppBar
- func (t *TopAppBar) SetNavigation(i icon.Icon, action func(view View)) *TopAppBar
- func (t *TopAppBar) SetTitle(str string) *TopAppBar
- func (t *TopAppBar) Style(style ...Style) *TopAppBar
- type TypeWeight
- type VStack
- func (t *VStack) AddViews(views ...View) *VStack
- func (t *VStack) AppendViews(views ...View) ViewGroup
- func (t *VStack) ClearViews() ViewGroup
- func (b VStack) Context() Context
- func (b VStack) Release()
- func (t *VStack) RemoveAll() *VStack
- func (b VStack) Scope() context.Context
- func (t *VStack) Self(ref **VStack) *VStack
- func (t *VStack) Style(style ...Style) *VStack
- func (t *VStack) StyleFor(criteria MediaCriteria, style ...Style) *VStack
- type View
- type ViewGroup
- type Watch
- type Window
- func (w *Window) AddView(v View) *Window
- func (w *Window) AddViews(views ...View) *Window
- func (w *Window) AppendViews(views ...View) ViewGroup
- func (w *Window) ClearViews() ViewGroup
- func (w *Window) Context() Context
- func (w *Window) Release()
- func (w *Window) RemoveAll() *Window
- func (w *Window) RemoveView(v View)
- func (w *Window) Scope() context.Context
- func (w *Window) SetBackground(url string) *Window
Constants ¶
This section is empty.
Variables ¶
var BuildGitBranch = "unknown"
var BuildGitCommit = "unknown"
var BuildHost = "unknown"
var Colors = map[string]Color{ "Purple": Purple, "Teal": Teal, "Error": Error, "Red50": Red50, "Pink50": Pink50, "Purple50": Purple50, "DeepPurple50": DeepPurple50, "Indigo50": Indigo50, "Blue50": Blue50, "LightBlue": LightBlue, "Cyan50": Cyan50, "Teal50": Teal50, "Green50": Green50, "LightGreen50": LightGreen50, "Lime50": Lime50, "Yellow50": Yellow50, "Amber50": Amber50, "Orange50": Orange50, "DeepOrange50": DeepOrange50, "Brown50": Brown50, "Gray50": Gray50, "BlueGray50": BlueGray50, }
var DefaultPadding = Pixel(8)
var GoSyntax = Highlighter{ // contains filtered or unexported fields }
var Green = RGBA(0, 255, 0, 255)
Functions ¶
func ShowMessage ¶
Types ¶
type AbsApplication ¶
type AbsApplication interface {
SetView(view View)
}
type Alignment ¶
type Alignment string
const Leading Alignment = "leading"
const Trailing Alignment = "trailing"
type Application ¶
type Application struct {
// contains filtered or unexported fields
}
func NewApplication ¶
func NewApplication(this AbsApplication, expectedVersion string) *Application
func (*Application) Context ¶
func (a *Application) Context() Context
func (*Application) Route ¶
func (a *Application) Route(path string, f func(Query) View) *Application
func (*Application) SetView ¶
func (a *Application) SetView(view View)
func (*Application) Start ¶
func (a *Application) Start()
func (*Application) UnmatchedRoute ¶
func (a *Application) UnmatchedRoute(f func(Query) View) *Application
func (*Application) Window ¶
func (a *Application) Window() *Window
type Button ¶
type Button struct { Text string // contains filtered or unexported fields }
func (*Button) AddClickListener ¶
AddClickListener registers another click listener
func (*Button) SetEnabled ¶
func (*Button) SetStyleKind ¶
func (t *Button) SetStyleKind(s ButtonStyleKind) *Button
type ButtonStyleKind ¶
type ButtonStyleKind string
const Default ButtonStyleKind = "mdc-button"
const Dlg ButtonStyleKind = "mdc-dialog__button"
const Outlined ButtonStyleKind = "mdc-button--outlined"
const Raised ButtonStyleKind = "mdc-button--raised"
const Unelevated ButtonStyleKind = "mdc-button--unelevated"
type Card ¶
type Card struct {
// contains filtered or unexported fields
}
Card represents the material card component, see https://material.io/components/cards.
func (*Card) AppendViews ¶
func (*Card) ClearViews ¶
type Checkbox ¶
type Checkbox struct {
// contains filtered or unexported fields
}
func NewCheckbox ¶
func NewCheckbox() *Checkbox
func (*Checkbox) AddChangeListener ¶
func (*Checkbox) Indeterminate ¶
func (*Checkbox) SetChecked ¶
func (*Checkbox) SetEnabled ¶
func (*Checkbox) SetIndeterminate ¶
type CircularProgress ¶
type CircularProgress struct {
// contains filtered or unexported fields
}
func NewCircularProgress ¶
func NewCircularProgress() *CircularProgress
func (*CircularProgress) Self ¶
func (t *CircularProgress) Self(ref **CircularProgress) *CircularProgress
Self assigns the receiver to the given pointer to reference
func (*CircularProgress) Style ¶
func (t *CircularProgress) Style(style ...Style) *CircularProgress
type Code ¶
type Code struct {
// contains filtered or unexported fields
}
func NewCode ¶
func NewCode(hl Highlighter, str string) *Code
type Color ¶
type Color uint32
const ( Purple Color = 0x6200EEFF Teal Color = 0x03DAC5FF Error Color = 0xB00020FF Red50 Color = 0xF44336FF Pink50 Color = 0xE91E63FF Purple50 Color = 0x9C27B0FF DeepPurple50 Color = 0x673AB7FF Indigo50 Color = 0x3F51B5FF Blue50 Color = 0x2196F3FF LightBlue Color = 0x03A9F4FF Cyan50 Color = 0x00BCD4FF Teal50 Color = 0x009688FF Green50 Color = 0x4CAF50FF LightGreen50 Color = 0x8BC34AFF Lime50 Color = 0xCDDC39FF Yellow50 Color = 0xFFEB3BFF Amber50 Color = 0xFFC107FF Orange50 Color = 0xFF9800FF DeepOrange50 Color = 0xFF5722FF Brown50 Color = 0x795548FF Gray50 Color = 0x9e9e9eFF BlueGray50 Color = 0x607D8BFF )
func ParseColor ¶
ParseColor currently can only evaluate codes like #6200ee??
type Context ¶
type Context interface { Routes() []Route // Languages returns the user preferred languages. It is never empty and returns "und" if not known. Languages() []string // Invalidate tries to reload the affected view as efficient as possible. However it may likely just reload // the entire current url Invalidate() // contains filtered or unexported methods }
func NewContext ¶
type Dialog ¶
type Dialog struct { Value string // contains filtered or unexported fields }
type DisplayType ¶
type DisplayType string
const DisplayNone DisplayType = "none"
const DisplayVisible DisplayType = "unset"
type Drawer ¶
type Drawer struct {
// contains filtered or unexported fields
}
type ErrorView ¶
type ErrorView struct { *VStack // contains filtered or unexported fields }
func NewErrorView ¶
type FontStyle ¶
type FontStyle string
const Body FontStyle = "mdc-typography--body1"
const Body2 FontStyle = "mdc-typography--body2"
const Btn FontStyle = "mdc-typography--button"
const Caption FontStyle = "mdc-typography--caption"
const DrawerSubTitle FontStyle = "mdc-drawer__subtitle"
const DrawerTitle FontStyle = "mdc-drawer__title"
const Headline1 FontStyle = "mdc-typography--headline1"
const Headline2 FontStyle = "mdc-typography--headline2"
const Headline3 FontStyle = "mdc-typography--headline3"
const Headline4 FontStyle = "mdc-typography--headline4"
const Headline5 FontStyle = "mdc-typography--headline5"
const Headline6 FontStyle = "mdc-typography--headline6"
const Overline FontStyle = "mdc-typography--overline"
const Subtitle1 FontStyle = "mdc-typography--subtitle1"
const Subtitle2 FontStyle = "mdc-typography--subtitle1"
type Frame ¶
type Frame struct {
// contains filtered or unexported fields
}
func (*Frame) AppendViews ¶
func (*Frame) ClearViews ¶
type Grid ¶
type Grid struct {
// contains filtered or unexported fields
}
A Grid offers a grid-based layout, where you define the area of children with rows and columns.
func (*Grid) AppendViews ¶
AppendViews adds all views.
func (*Grid) SetAreas ¶
SetAreas defines the grid layout "visually" in a two dimensional string array. Example:
SetAreas([][]string{ {"header", "header", "header"}, {"menu", "main", "main"}, {"menu", "footer", "footer"}, })
Use the Area
func (*Grid) SetColumnGap ¶
SetColumnGap defines the column margin between children.
func (*Grid) SetColumnWidths ¶
SetColumnWidths defines two things: firstly how many columns at all and secondly how they are calculated. You can also use the *Auto*-scalar.
func (*Grid) SetHorizontalAlign ¶
SetHorizontalAlign determines how columns are distributed inside the grid container
func (*Grid) SetRowHeights ¶
SetRowHeights defines two things: firstly how many rows at all and secondly how they are calculated. You can also use the *Auto*-scalar.
func (*Grid) SetVerticalAlign ¶
SetVerticalAlign determines how rows are distributed inside the grid container
type GridAlign ¶
type GridAlign string
GridAlign
const ( // SpaceEvenly distributes cells evenly in height (vertically) or width (horizontally). SpaceEvenly GridAlign = "space-evenly" // SpaceBetween distributes the free space equally *between* each item in height (vertically) or // (horizontally) SpaceBetween GridAlign = "space-between" // SpaceAround distributes the free space equally *around* each item in height (vertically) or // width (horizontally) SpaceAround GridAlign = "space-around" // Center aligns cells in the center of the grid container, affects rows (vertically) or // columns (horizontally) Center GridAlign = "center" // Start aligns the cells at the left (horizontally) or top (vertically). Start GridAlign = "start" // End aligns the cells at the right (horizontally) or bottom (vertically). End GridAlign = "end" )
type GridLayoutParams ¶
type GridLayoutParams struct {
Area string
}
GridLayoutParams define how a view spans inside the grid container.
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) AppendViews ¶
func (*Group) ClearViews ¶
type HStack ¶
type HStack struct {
*Grid
}
HStack is a horizontal grid with just a single row.
func (*HStack) AppendViews ¶
func (*HStack) ClearViews ¶
type Highlighter ¶
type Highlighter struct {
// contains filtered or unexported fields
}
type IconButton ¶
An IconButton is a rounded button with an icon or a single character on it
func (*IconButton) AddClickListener ¶
func (t *IconButton) AddClickListener(f func(v View)) *IconButton
AddClickListener registers another click listener
func (*IconButton) Self ¶
func (t *IconButton) Self(ref **IconButton) *IconButton
Self assigns the receiver to the given pointer to reference
func (*IconButton) Set ¶
func (t *IconButton) Set(str icon.Icon) *IconButton
Set updates the material icon
func (*IconButton) SetChar ¶
func (t *IconButton) SetChar(r rune) *IconButton
SetChar violates the material spec and allows to set a unicode character codepoint instead of an icon
func (*IconButton) Style ¶
func (t *IconButton) Style(style ...Style) *IconButton
Style applies generic style attributes.
type InputType ¶
type InputType string
const Date InputType = "date"
const DateTime InputType = "datetime"
const DateTimeLocal InputType = "datetime-local"
const EMail InputType = "email"
const Month InputType = "month"
const Number InputType = "number"
const Password InputType = "password"
const Range InputType = "range"
const Search InputType = "search"
const Tel InputType = "tel"
const Time InputType = "time"
const Txt InputType = "text"
const URL InputType = "url"
const Week InputType = "week"
type LinearProgress ¶
type LinearProgress struct {
// contains filtered or unexported fields
}
func NewLinearProgress ¶
func NewLinearProgress() *LinearProgress
func (*LinearProgress) Self ¶
func (t *LinearProgress) Self(ref **LinearProgress) *LinearProgress
Self assigns the receiver to the given pointer to reference
func (*LinearProgress) SetIndeterminate ¶
func (t *LinearProgress) SetIndeterminate(b bool) *LinearProgress
func (*LinearProgress) SetProgress ¶
func (t *LinearProgress) SetProgress(f float64) *LinearProgress
func (*LinearProgress) SetSecondaryProgress ¶
func (t *LinearProgress) SetSecondaryProgress(f float64) *LinearProgress
func (*LinearProgress) Style ¶
func (t *LinearProgress) Style(style ...Style) *LinearProgress
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) SetCaption ¶
func (*Link) SetTarget ¶
func (t *Link) SetTarget(target LinkTarget) *Link
type LinkTarget ¶
type LinkTarget string
const TargetBlank LinkTarget = "_blank"
const TargetParent LinkTarget = "_parent"
const TargetSelf LinkTarget = "_self"
const TargetTop LinkTarget = "_top"
type List ¶
type List struct {
// contains filtered or unexported fields
}
func NewSelectionList ¶
func NewSelectionList() *List
func (*List) AddSelectListener ¶
func (*List) SelectedIndex ¶
func (*List) SetSelectedIndex ¶
type ListHeader ¶
type ListHeader struct {
// contains filtered or unexported fields
}
func NewListHeader ¶
func NewListHeader(caption string) *ListHeader
func (*ListHeader) SetText ¶
func (t *ListHeader) SetText(s string) *ListHeader
type ListItem ¶
type ListItem struct {
// contains filtered or unexported fields
}
func NewListItem ¶
func NewListTwoLineItem ¶
func (*ListItem) AddClickListener ¶
func (*ListItem) SetLeadingView ¶
func (*ListItem) SetSelected ¶
func (*ListItem) SetTrailingView ¶
type ListSeparator ¶
type ListSeparator struct {
// contains filtered or unexported fields
}
func NewListSeparator ¶
func NewListSeparator() *ListSeparator
type MediaCriteria ¶
type MediaCriteria string
MediaCriteria describes rules to match against various screen properties.
func MatchAll ¶
func MatchAll(criterias ...MediaCriteria) MediaCriteria
MatchAll concats all given criterias into a big and statement
func MatchLandscape ¶
func MatchLandscape() MediaCriteria
MatchLandscape matches for a screen where the width is longer than the height
func MatchMaxHeight ¶
func MatchMaxHeight(scalar Scalar) MediaCriteria
MatchMaxWidth returns a criteria for a max height
func MatchMaxWidth ¶
func MatchMaxWidth(scalar Scalar) MediaCriteria
MatchMaxWidth returns a criteria for a max width
func MatchMinHeight ¶
func MatchMinHeight(scalar Scalar) MediaCriteria
MatchMinHeight returns a criteria for a min height
func MatchMinWidth ¶
func MatchMinWidth(scalar Scalar) MediaCriteria
MatchMinWidth returns a criteria for a min width
func MatchOne ¶
func MatchOne(criterias ...MediaCriteria) MediaCriteria
MatchOne concats all given criterias into a big or statement
func MatchPortrait ¶
func MatchPortrait() MediaCriteria
MatchPortrait matches for a screen where the height is longer than the width
type MediaMatcher ¶
type MediaMatcher struct {
// contains filtered or unexported fields
}
MediaMatcher registers multiple matching and a non-matching callback a number of criterias to the view. If the view is destroyed, the callbacks are unregistered.
func NewMediaMatcher ¶
func NewMediaMatcher(scope View, noMatch func(view View)) *MediaMatcher
func (*MediaMatcher) Add ¶
func (m *MediaMatcher) Add(criteria MediaCriteria, onMatch func(view View))
Add appends another criteria to evaluate. The given callback is invoked, if it matches the criteria. Only the first registered and matching criteria is invoked.
func (*MediaMatcher) Check ¶
func (m *MediaMatcher) Check()
Check evaluates all registered criterias and applies the first matching callback. It only invokes a callback if it has not been active. The noMatch callback is only called, if no active criteria match has been found. It will be called internally automatically, if some environment conditions like the screen size has changed. It is safe to be invoked on a nil pointer.
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
func (*Menu) ReleaseOnClose ¶
type MenuItem ¶
type MenuItem struct {
// contains filtered or unexported fields
}
func NewMenuDivider ¶
func NewMenuDivider() *MenuItem
func NewMenuItem ¶
func (*MenuItem) SetCaption ¶
func (*MenuItem) SetEnabled ¶
func (*MenuItem) SetSelectListener ¶
type Model ¶
type Model struct { Value interface{} // contains filtered or unexported fields }
func (*Model) AddListener ¶
func (p *Model) AddListener(cb ModelChanged) Handle
func (*Model) RemoveListener ¶
type ModelChanged ¶
type ModelChanged func(value interface{})
type NamedParameter ¶
func IntParam ¶
func IntParam(key string, val int) NamedParameter
func StrParam ¶
func StrParam(key string, val string) NamedParameter
type OverflowType ¶
type OverflowType string
const OverflowAuto OverflowType = "auto"
const OverflowHidden OverflowType = "hidden"
const OverflowScroll OverflowType = "scroll"
type Picker ¶
type Picker struct {
// contains filtered or unexported fields
}
Picker is also known as Combobox, Dropdown or Spinner.
func (*Picker) BindText ¶
BindText is a shortcut for TextProperty().Bind() and returning self. If used together with #SetSelected() the order matters. When populated from/to a model, you likely want to first select a default (by index) and then bind to the model, which reads the value from the given pointer. However if that is invalid, it does nothing, otherwise selects the right index by name.
func (*Picker) SetEnabled ¶
func (*Picker) SetInvalid ¶
func (*Picker) SetOptions ¶
func (*Picker) SetSelectListener ¶
func (*Picker) SetSelected ¶
func (*Picker) SetText ¶
SetText tries to find the text in "options" and selects the index, if possible. Otherwise does nothing.
func (*Picker) Text ¶
Text returns the current selected option text. If nothing is selected returns the empty string.
func (*Picker) TextProperty ¶
TextProperty returns a text property to or get the text.
type PositionType ¶
type PositionType string
const PositionAbsolute PositionType = "absolute"
const PositionFixed PositionType = "fixed"
const PositionInitial PositionType = "initial"
const PositionRelative PositionType = "relative"
type Resource ¶
type Resource interface {
Release() // Release clean up references and the resource must not be used afterwards anymore.
}
A Resource release method should be called for any resource, as soon as it is not required anymore to avoid memory leaks. Afterwards the Resource must not be used anymore. Even though we have a GC, we cannot rely on it, because the Resource may have registrations beyond our process, which requires holding global callback references, so that the outer system can call us. An example for this are go functions wrapped as callbacks in the wasm tier made available for the javascript DOM, like event handlers. Also cgo or rpc mechanism are possible.
func NewListener ¶
func NewListener(f interface{}, onRelease func()) Resource
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) Invalidate ¶
func (*Router) SetUnhandledRouteAction ¶
type Scalar ¶
type Scalar string
func Auto ¶
func Auto() Scalar
Auto may have different meanings, depending on the used context.
Grid - if possible, take mostly the required space (fit-content), however - if not reasonable (like others have fixed sizes or everything is auto), stretch to availabel space
func Fraction ¶
Fraction is used for Grid containers to define how a fraction of the remaining available space is distributed.
func PercentViewPortHeight ¶
func PercentViewPortWidth ¶
type Snackbar ¶
type Snackbar struct {
// contains filtered or unexported fields
}
func NewSnackbar ¶
func (*Snackbar) SetActionLabel ¶
func (*Snackbar) SetTimeout ¶
SetTimeout value must be between 4000 and 10000 (or -1 to disable the timeout completely) or an error will be thrown. Defaults is 5 seconds.
type Spacer ¶
type Spacer struct {
// contains filtered or unexported fields
}
deprecated
type Style ¶
type Style interface {
// contains filtered or unexported methods
}
A Style modifies different kinds of visualization of a View.
func BackgroundColor ¶
func BorderRadius ¶
BorderRadius sets all 4 edges to the same radius
func Display ¶
func Display(displayType DisplayType) Style
func FontWeight ¶
func FontWeight(weight TypeWeight) Style
func ForegroundColor ¶
func MarginBottom ¶
func MarginLeft ¶
func MarginRight ¶
func Overflow ¶
func Overflow(overflow OverflowType) Style
func Position ¶
func Position(position PositionType) Style
type TabView ¶
type TabView struct {
// contains filtered or unexported fields
}
func NewTabView ¶
func NewTabView() *TabView
func (*TabView) SetScrollable ¶
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
func (*Table) RowSelection ¶
func (*Table) SetRowClickListener ¶
SetRowClickListener registers a row click listener, which has nothing to do with the row selection.
func (*Table) SetRowSelection ¶
func (*Table) SetSelected ¶
func (*Table) SetSelectionChangeListener ¶
type Text ¶
type Text struct { Value string // contains filtered or unexported fields }
type TextArea ¶
type TextArea struct {
// contains filtered or unexported fields
}
func NewTextArea ¶
func NewTextArea() *TextArea
func (*TextArea) InputStyle ¶
Styles changes the
func (*TextArea) SetEnabled ¶
func (*TextArea) SetInvalid ¶
func (*TextArea) SetMaxLength ¶
func (*TextArea) SetRequired ¶
type TextField ¶
type TextField struct {
// contains filtered or unexported fields
}
func NewTextField ¶
func NewTextField() *TextField
func (*TextField) AddClickListener ¶
AddClickListener registers another click listener
func (*TextField) AddFocusChangeListener ¶
AddFocusOutListener registers another key listener
func (*TextField) AddKeyDownListener ¶
AddKeyDownListener registers another key listener
func (*TextField) AddKeyUpListener ¶
AddKeyUpListener registers another key listener
func (*TextField) AddLeadingIconClickListener ¶
func (*TextField) AddTrailingIconClickListener ¶
func (*TextField) BindInt ¶
BindInt is a shortcut for IntProperty().Bind() and returning self. Initially the value is read from the pointers position and the component is populated. Afterwards only the value at the pointer location is updated by the component.
Text values which cannot be parsed as integers, are ignored.
func (*TextField) BindText ¶
BindText is a shortcut for TextProperty().Bind() and returning self. Initially the value is read from the pointers position and the component is populated. Afterwards only the value at the pointer location is updated by the component.
func (*TextField) IntProperty ¶
IntProperty returns an int property to set or get the text with integer to string conversions.
func (*TextField) SetEnabled ¶
func (*TextField) SetHelperPersistent ¶
func (*TextField) SetInputType ¶
func (*TextField) SetInvalid ¶
func (*TextField) SetMaxLength ¶
func (*TextField) SetRequired ¶
func (*TextField) TextProperty ¶
TextProperty returns a text property to set or get the text.
type ThemeController ¶
type ThemeController struct {
// contains filtered or unexported fields
}
func Theme ¶
func Theme() ThemeController
func (ThemeController) Color ¶
func (t ThemeController) Color() Color
Color returns the current primary theme background color
func (ThemeController) ForegroundColor ¶
func (t ThemeController) ForegroundColor() Color
ForegroundColor returns the current primary theme foreground color
func (ThemeController) SetColor ¶
func (t ThemeController) SetColor(color Color)
Color sets the current primary theme background color
func (ThemeController) SetForegroundColor ¶
func (t ThemeController) SetForegroundColor(color Color)
SetForegroundColor sets the current primary theme foreground color
type TopAppBar ¶
type TopAppBar struct {
// contains filtered or unexported fields
}
func NewTopAppBar ¶
func NewTopAppBar() *TopAppBar
func (*TopAppBar) AddActions ¶
func (*TopAppBar) SetNavigation ¶
type TypeWeight ¶
type TypeWeight string
const WeightBolder TypeWeight = "500"
const WeightLighter TypeWeight = "lighter"
const WeightNormal TypeWeight = "normal"
type VStack ¶
type VStack struct {
*Grid
}
VStack is actually a vertical grid, with just a single column.
func (*VStack) AppendViews ¶
func (*VStack) ClearViews ¶
type View ¶
type View interface { Resource Context() Context // Context of View, usually taken from the top-most root, where parent is nil Scope() context.Context // Scope of the view, which is cancelled as soon as the view is destroyed. // contains filtered or unexported methods }
A View is a absComponent on screen. It may not be visible, if it has not been attached yet. It is usually created through a constructor method (New<View>) and is a pointer to a struct, which itself may contain more components. It is not safe to be used concurrently and must only be modified by the UI thread.
type ViewGroup ¶
ViewGroup is a generic interface which all view groups should support. Sadly go does not allow covariant return types in interfaces, so we have to define another signature set. See also https://github.com/golang/go/issues/30602.
type Watch ¶
type Watch struct {
// contains filtered or unexported fields
}
func (*Watch) AddListener ¶
func (*Watch) SetInterval ¶
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
func GetWindow ¶
GetWindow tries to return the window from the given view tree. The window is usually the view root. If the view is not attached, returns nil.
func (*Window) AppendViews ¶
func (*Window) ClearViews ¶
func (*Window) RemoveView ¶
func (*Window) Scope ¶
because releasing a window has no effect, this returned scope cannot be cancelled.
func (*Window) SetBackground ¶
SetBackground sets the window background image buffer. The image is scaled using cover and centered inside.
Source Files
¶
- app.go
- build.go
- button.go
- card.go
- checkbox.go
- circularprogress.go
- code.go
- color.go
- component.go
- context.go
- dialog.go
- drawer.go
- error.go
- frame.go
- grid.go
- group.go
- hstack.go
- icon.go
- iconbutton.go
- linearprogress.go
- link.go
- list.go
- listener.go
- menu.go
- package.go
- picker.go
- post.go
- responsive.go
- router.go
- scalar.go
- snackbar.go
- spacer.go
- style.go
- table.go
- tabview.go
- text.go
- textarea.go
- textfield.go
- theme.go
- topappbar.go
- util.go
- view.go
- viewgroup.go
- viewmodel.go
- vstack.go
- watch.go
- window.go
Directories
¶
Path | Synopsis |
---|---|
event contains the wtk specific event types
|
event contains the wtk specific event types |
views contains a more modular package structure, where each component has its own package.
|
views contains a more modular package structure, where each component has its own package. |
hstepper
hstepper contains a horizontal stepper component.
|
hstepper contains a horizontal stepper component. |