55 lines
1.0 KiB
Go
55 lines
1.0 KiB
Go
package main
|
||
|
||
import (
|
||
"git.frankmayer.dev/tsukinoko-kun/naive"
|
||
)
|
||
|
||
func main() {
|
||
Text1 := naive.UseEffect("foo")
|
||
|
||
views := make([]naive.View, 2)
|
||
|
||
views[0] = naive.StackView{
|
||
Children: []naive.View{
|
||
naive.TextView{
|
||
Content: Text1,
|
||
},
|
||
naive.ButtonView{
|
||
Content: naive.StringTextContent("Back"),
|
||
OnClick: func() {
|
||
naive.SetView(views[1])
|
||
},
|
||
},
|
||
},
|
||
Orientation: naive.LayoutOrientationVertical,
|
||
}
|
||
|
||
views[1] = naive.TabView{
|
||
Children: []naive.TabViewItem{
|
||
{
|
||
Title: naive.StringTextContent("Tab 1️⃣"),
|
||
Content: naive.StackView{
|
||
Children: []naive.View{
|
||
naive.ButtonView{
|
||
Content: Text1,
|
||
OnClick: func() {
|
||
naive.SetView(views[0])
|
||
},
|
||
},
|
||
naive.TextInputView{
|
||
Value: Text1,
|
||
Placeholder: Text1,
|
||
},
|
||
naive.TextInputView{
|
||
Placeholder: naive.StringTextContent("just for fun"),
|
||
},
|
||
},
|
||
Orientation: naive.LayoutOrientationVertical,
|
||
},
|
||
},
|
||
},
|
||
}
|
||
|
||
naive.StartApp("Meep", views[1])
|
||
}
|