- Create main.go:
package main
import (
	"github.com/VoileLab/toolgui/toolgui/tgcomp"
	"github.com/VoileLab/toolgui/toolgui/tgexec"
	"github.com/VoileLab/toolgui/toolgui/tgframe"
)
func main() {
	app := tgframe.NewApp()
	app.AddPage("index", "Index", func(p *tgframe.Params) error {
		tgcomp.Text(p.Main, "Hello world")
		return nil
	})
	tgexec.NewWebExecutor(app).StartService(":3001")
}
- Create go.mod and download toolgui:
go mod init toolgui-helloworld
go mod tidy
- Run helloworld
go run main.go
- Create a ToolGUI App: The Appintance include the info that app needs.
app := tgframe.NewApp()
- Register a page in App: Tell Appinstance, we will have a page in the App.
- indexis the name.
- Indexis the title.
 
app.AddPage("index", "Index", ...)
- The Page Func: Draw a text component in the Main container.
func(p *tgframe.Params) error {
	tgcomp.Text(p.Main, "Hello world")
	return nil
}
- WebExecuter: The Apponly includes the logic of app, but not includes GUI.
The we executer provide web server GUI interface forApp.
tgexec.NewWebExecutor(app).StartService(":3001")