Documentation
¶
Overview ¶
Package tab runs a widget tree in a plain browser tab, on a <canvas>, through go-widgets/webcanvas: no compositor, no SharedArrayBuffer, no cross-origin isolation. It is what window.Open returns on js/wasm when the page is not a wasmdesk/wasmbox client, so ONE application runs unchanged natively, inside wasmdesk, and in an ordinary tab served from anywhere.
Tree, the adapter between a widget tree and webcanvas's App, has no build tag: it is plain Go, tested off the browser. Only tab_js.go touches the DOM.
Index ¶
- type Tree
- func (t *Tree) Char(s string) bool
- func (t *Tree) Click(x, y int) bool
- func (t *Tree) Context(x, y int) bool
- func (t *Tree) Draw(buf []byte)
- func (t *Tree) KeyDown(s string) bool
- func (t *Tree) Modifiers(m webcanvas.Modifiers)
- func (t *Tree) Move(x, y int) bool
- func (t *Tree) Release(x, y int) bool
- func (t *Tree) Repaint()
- func (t *Tree) RepaintWith(request func())
- func (t *Tree) Resize(w, h int) (int, int)
- func (t *Tree) Scroll(x, y, dx, dy int) bool
- func (t *Tree) Size() (int, int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Tree ¶
type Tree struct {
// contains filtered or unexported fields
}
Tree is a widget tree as a webcanvas scene.
func (*Tree) Draw ¶
Draw paints the tree into buf, the w×h RGBA framebuffer webcanvas keeps between frames -- which is what lets an incremental root repaint only what it reports damaged.
func (*Tree) KeyDown ¶
KeyDown is a named key, or a modified one -- whose modifiers Modifiers has just recorded, so Ctrl+A arrives as "a" with Ctrl set.
func (*Tree) Repaint ¶ added in v0.88.0
func (t *Tree) Repaint()
Repaint asks for a frame, from any goroutine. Before Run hands over the request it does nothing: the first frame is drawn anyway.
func (*Tree) RepaintWith ¶ added in v0.88.0
func (t *Tree) RepaintWith(request func())
RepaintWith keeps webcanvas's way to ask for a frame.