From 8cf3c8ca1b193c454b8a79ad921ea5f4890da013 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 27 Feb 2025 17:15:15 -0500 Subject: select widget --- ui.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ui.c') diff --git a/ui.c b/ui.c index f44e89d..65ce084 100644 --- a/ui.c +++ b/ui.c @@ -2,7 +2,14 @@ #include "widget.h" #include "ui.h" + +#define nelem(arr) (sizeof(arr)/sizeof(arr[0])) + + void init_ui(UI *ui) { - init_field(&ui->displacement); + w_init_field(&ui->displacement); + + static const char *const displacement_units[] = {"cc", "l", "ci"}; + w_init_select(&ui->displacement_unit, nelem(displacement_units), displacement_units); } -- cgit v1.2.3