widgets

package
v0.0.0-...-cc31ceb Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddWidget

func AddWidget(name string, widg Widget)

AddWidget allows you to add your own widgets

func ChangeSelected

func ChangeSelected(newselected int)

ChangeSelected changes the selected widget

func GenWidgets

func GenWidgets()

GenWidgets generates all the widgets

func Init

func Init(win *fyne.Window, pathfile string)

Init receives the window, file, and initializes widgets

func LoadLayout

func LoadLayout(p string, funcs map[string]func()) fyne.CanvasObject

LoadLayout allows you to load a layout file and get a CanvasObject

func Read

func Read()

Read reads the file

func Save

func Save()

Save saves the data

func UpdateUI

func UpdateUI()

UpdateUI builds the editor

Types

type Button

type Button struct {
	Title      string
	DeleteFunc func()

	OnClick string
	Text    string
}

Button is a button

func (*Button) Build

func (b *Button) Build() fyne.CanvasObject

Build builds the layout

func (*Button) BuildTree

func (b *Button) BuildTree() fyne.CanvasObject

BuildTree builds the tree view

func (*Button) Clone

func (b *Button) Clone() Widget

Clone duplicates the widget with the same data

func (*Button) Delete

func (b *Button) Delete(deletefunc func())

Delete provides a function to give the DeleteFunc

func (*Button) Serialize

func (b *Button) Serialize() WidgetSerialized

Serialize creats a serialized form with the same data

type ButtonSerialized

type ButtonSerialized struct {
	Title string

	OnClick string
	Text    string
}

ButtonSerialized is the serialized form of a button

func (*ButtonSerialized) Deserialize

func (b *ButtonSerialized) Deserialize(deleteFunc func()) Widget

Deserialize creates a deserialized version of the widget

type Hbox

type Hbox struct {
	Children   []Widget
	Title      string
	DeleteFunc func()
}

Hbox is a fyne Hbox

func (*Hbox) Build

func (h *Hbox) Build() fyne.CanvasObject

Build builds the layout

func (*Hbox) BuildTree

func (h *Hbox) BuildTree() fyne.CanvasObject

BuildTree builds the tree view

func (*Hbox) Clone

func (h *Hbox) Clone() Widget

Clone duplicates the widget with the same data

func (*Hbox) Delete

func (h *Hbox) Delete(deletefunc func())

Delete provides a function to give the DeleteFunc

func (*Hbox) Serialize

func (h *Hbox) Serialize() WidgetSerialized

Serialize creats a serialized form with the same data

type HboxSerialized

type HboxSerialized struct {
	Title    string
	Children []WidgetSerialized
}

HboxSerialized a serialized vbox

func (*HboxSerialized) Deserialize

func (h *HboxSerialized) Deserialize(deleteFunc func()) Widget

Deserialize creates a deserialized version of the widget

type Label

type Label struct {
	Title      string
	DeleteFunc func()

	Text string
}

Label is a label

func (*Label) Build

func (l *Label) Build() fyne.CanvasObject

Build builds the layout

func (*Label) BuildTree

func (l *Label) BuildTree() fyne.CanvasObject

BuildTree builds the tree view

func (*Label) Clone

func (l *Label) Clone() Widget

Clone duplicates the widget with the same data

func (*Label) Delete

func (l *Label) Delete(deletefunc func())

Delete provides a function to give the DeleteFunc

func (*Label) Serialize

func (l *Label) Serialize() WidgetSerialized

Serialize creats a serialized form with the same data

type LabelSerialized

type LabelSerialized struct {
	Title string
	Text  string
}

LabelSerialized is the serialized form of a button

func (*LabelSerialized) Deserialize

func (l *LabelSerialized) Deserialize(deleteFunc func()) Widget

Deserialize creates a deserialized version of the widget

type QueuedWidget

type QueuedWidget struct {
	Widget Widget
	Name   string
}

QueuedWidget contains the data for a queued widget

type Root

type Root struct {
	Child Widget
	Funcs map[string]func()
}

Root is the root element

func (*Root) Build

func (r *Root) Build() fyne.CanvasObject

Build builds the layout

func (*Root) BuildTree

func (r *Root) BuildTree() fyne.CanvasObject

BuildTree builds the layout for the tree view

func (*Root) Clone

func (r *Root) Clone() Widget

func (*Root) Delete

func (r *Root) Delete(func())

func (*Root) Serialize

func (r *Root) Serialize() WidgetSerialized

type RootSerialized

type RootSerialized struct {
	Child WidgetSerialized
}

func (*RootSerialized) Deserialize

func (r *RootSerialized) Deserialize(func()) Widget

type Vbox

type Vbox struct {
	Children   []Widget
	Title      string
	DeleteFunc func()
}

Vbox is a fyne VBox

func (*Vbox) Build

func (v *Vbox) Build() fyne.CanvasObject

Build builds the layout

func (*Vbox) BuildTree

func (v *Vbox) BuildTree() fyne.CanvasObject

BuildTree builds the tree view

func (*Vbox) Clone

func (v *Vbox) Clone() Widget

Clone duplicates the widget with the same data

func (*Vbox) Delete

func (v *Vbox) Delete(deletefunc func())

Delete provides a function to give the DeleteFunc

func (*Vbox) Serialize

func (v *Vbox) Serialize() WidgetSerialized

Serialize creats a serialized form with the same data

type VboxSerialized

type VboxSerialized struct {
	Title    string
	Children []WidgetSerialized
}

VboxSerialized a serialized vbox

func (*VboxSerialized) Deserialize

func (v *VboxSerialized) Deserialize(deleteFunc func()) Widget

Deserialize creates a deserialized version of the widget

type Widget

type Widget interface {
	Build() fyne.CanvasObject
	BuildTree() fyne.CanvasObject
	Delete(func())
	Clone() Widget
	Serialize() WidgetSerialized
}

Widget allows you to recursively build the layouts

type WidgetSerialized

type WidgetSerialized interface {
	Deserialize(func()) Widget
}

WidgetSerialized allows you to serialize the widgets

Jump to

Keyboard shortcuts

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