example

package module
v0.0.0-...-1e606eb Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2020 License: Apache-2.0 Imports: 33 Imported by: 0

README

wtk-example

wtk kitchen sink demo. It is inspired by the SwiftUI tutorial. The only available implementation is WTK with a WASM HTML core.

Section 1

A View must comply to the View interface. It cannot be implemented entirely by your own, because it contains some hidden implementation specific contracts. You have to implement a View interface by embedding an existing view or container. By convention, you should always provide a factory method prefixed with New followed by your views name.

package section1

import . "github.com/golangee/forms"

type ContentView struct {
	*Text
}

func NewContentView() *ContentView {
	return &ContentView{Text: NewText("hello world")}
}

Section 2

You can style your View in a fluent way, using the predefined parameters.

package section2

import . "github.com/golangee/forms"

type ContentView struct {
	*Text
}

func NewContentView() *ContentView {
	return &ContentView{
		Text: NewText("Turtle Rock").
			Style(
				ForegroundColor(Green),
				Font(Title),
			),
	}
}

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type App

type App struct {
	*Application
}

func NewApp

func NewApp() *App

func (*App) Start

func (a *App) Start()

func (*App) WithDrawer

func (a *App) WithDrawer(f func(q Query) View) func(Query) View

Jump to

Keyboard shortcuts

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