diff options
| author | iamcheeseman <[email protected]> | 2026-05-17 20:07:11 -0400 |
|---|---|---|
| committer | iamcheeseman <[email protected]> | 2026-05-17 20:07:11 -0400 |
| commit | dcfe8e6f08b1722639ad8e64db7553c60d3c7d11 (patch) | |
| tree | 92c46670fa9d374436d9753f229fd0b2f5d3a34b /dc | |
| parent | 9642787fac5b3586f30bc07e4430784a658ba38f (diff) | |
GUI sliders
Diffstat (limited to 'dc')
| -rw-r--r-- | dc/dc.c | 23 |
1 files changed, 23 insertions, 0 deletions
@@ -81,6 +81,29 @@ void tick(void) tyui_text("example text"); if (tyui_button("press me")) toggled = !toggled; + + tyui_layout((float[]){0.1, 0.2, 0.5, 0.1, 0}); + static float xvalue = 10; + tyui_text("x"); + tyui_text("%g", xvalue); + tyui_slider(0, 100, 1, &xvalue); + if (tyui_button("^")) + xvalue++; + if (tyui_button("v")) + xvalue--; + xvalue = floor(xvalue); + + static float yvalue = 50; + tyui_text("y"); + tyui_text("%g", yvalue); + tyui_slider(0, 100, 1, &yvalue); + if (tyui_button("^")) + yvalue++; + if (tyui_button("v")) + yvalue--; + yvalue = floor(yvalue); + tyui_layout(NULL); + tyui_end_window(); } |
