diff options
Diffstat (limited to 'dc/dc.c')
| -rw-r--r-- | dc/dc.c | 39 |
1 files changed, 26 insertions, 13 deletions
@@ -69,7 +69,7 @@ void tick(void) if (tyui_begin_window("Test Window", ty_recti(5, 5, 100, 120), &winid1)) { tyui_button("before"); - tyui_push_layout((float[]){-50, -1, 0}); + tyui_push_layout((float[]){-49, -1, 0}); tyui_push_layout((float[]){-1, 0}); tyui_text_ex(TYUI_ALIGN_CENTER, "Buttons"); tyui_button("test1"); @@ -92,20 +92,33 @@ void tick(void) } if (tyui_begin_window("2nd Window", ty_recti(110, 5, 100, 120), &winid2)) { - static float value = 100; - tyui_slider(0, 100, &value); - tyui_slider_ex(0, 100, &value, true, TYUI_ALIGN_LEFT); - tyui_slider_ex(0, 100, &value, true, TYUI_ALIGN_RIGHT); - tyui_blank_slider(0, 100, &value); + static bool opened = false; - tyui_push_layout((float[]){50, -1, 0}); - tyui_slider(0, 100, &value); - if (tyui_button("inc")) - value++; + if (tyui_button("sliders")) + opened = !opened; + + if (opened) { + static float value = 100; tyui_slider(0, 100, &value); - if (tyui_button("dec")) - value--; - tyui_pop_layout(); + tyui_slider_ex(0, 100, &value, true, TYUI_ALIGN_LEFT); + tyui_slider_ex(0, 100, &value, true, TYUI_ALIGN_RIGHT); + tyui_blank_slider(0, 100, &value); + + tyui_push_layout((float[]){50, -1, 0}); + tyui_slider(0, 100, &value); + if (tyui_button("inc")) + value++; + tyui_slider(0, 100, &value); + if (tyui_button("dec")) + value--; + tyui_pop_layout(); + } + + static char string[16]; + static tyui_Text_Input tinput; + tinput.chars = string; + tinput.max_len = 16; + tyui_text_input(&tinput); tyui_end_window(); } |
