Skip to content

renlite/relnyne

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Declarative Style for Fyne UI

This library is still in development and is not ready to be used.

Relnyne is a very lightweigt extention of Fyne Widgets to describe the UI in a declarative way and offers a simple data and state container to manage the state and update. In opposite to Fyne UI DataBinding Relnyne is more DOM like, which should offer more direkt control over rendering.

A comparison of code blocks will be placed into the examples folder.

package main

import (
	rl "renlite/relnyne"

	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	w "fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	win := a.NewWindow("Hello")

	win.SetContent(container.NewVBox(
		rl.Lable("Fyne!", "#01"),
		w.NewButton("Say Hello!", clickHi),
	))

	win.ShowAndRun()
}

func clickHi(){
	// Option 1
	rl.GetLabel("#01").SetText("Hello Fyne!")
	// Option 2
	rl.GetWidget("#01").(*w.Label).SetText("Hello Fyne!")
	// Option 3? with Generics
	// rl.GetWidget[*w.Label]("#01")
}

About

Renlite declarative UI extention

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages