aboutsummaryrefslogtreecommitdiff
path: root/src/main.odin
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.odin')
-rw-r--r--src/main.odin36
1 files changed, 22 insertions, 14 deletions
diff --git a/src/main.odin b/src/main.odin
index f28fab4..a621812 100644
--- a/src/main.odin
+++ b/src/main.odin
@@ -1,5 +1,6 @@
package main
+import "core:fmt"
import t "tafl"
main :: proc() {
@@ -28,17 +29,21 @@ main :: proc() {
sizing_height=t.GROW,
sizing_width=t.FIT,
layout=.TOP_TO_BOTTOM)
- {t.tafl(color={0,0,0,0},
- sizing_height=t.GROW,
- sizing_width=t.GROW)}
- {t.tafl(
- padding={8,8,8,8},
- child_gap=8,
- color={.0, .0, .0, 0.4},
- )
- button("Yeet")
- button("Test")
- button("Render")
+ {
+ t.tafl(color={0,0,0,0},
+ sizing_height=t.GROW,
+ sizing_width=t.GROW)}
+ {
+ t.tafl(
+ padding={8,8,8,8},
+ child_gap=8,
+ color={.0, .0, .0, 0.4},
+ )
+ {
+ if button("Yeet", "yeet").clicked do fmt.println("YEEET!")
+ if button("Test", "test").clicked do fmt.println("Test!")
+ if button("Render", "render").clicked do fmt.println("Render!")
+ }
}
}
@@ -108,17 +113,20 @@ main :: proc() {
}
-button :: proc(text : string) {
- t.tafl(sizing_width=t.FIXED(120),
+button :: proc(text : string, id : string) -> t.Com {
+ com := t.tafl(sizing_width=t.FIXED(120),
sizing_height=t.FIXED(40),
color=colors.button_outline,
- padding={2,2,2,2})
+ padding={2,2,2,2},
+ flags=t.BUTTON,
+ id=id)
t.tafl(sizing_width=t.GROW,
sizing_height=t.GROW,
color={.1,.1,.1, 1},
position_horizontal=.MIDDLE,
position_vertical=.MIDDLE,)
t.tafl(text=text)
+ return com
}
Color_Scheme :: struct {