aboutsummaryrefslogtreecommitdiff
path: root/teensy/teensy_ui.c
diff options
context:
space:
mode:
authoriamcheeseman <[email protected]>2026-05-15 07:23:41 -0400
committeriamcheeseman <[email protected]>2026-05-15 07:23:41 -0400
commitbea8415263dddc1cb892c121446194688703bf27 (patch)
tree8f837d89fe4fc78a67b6fc51042f86ab5a9f2be4 /teensy/teensy_ui.c
parentcfde830b98e235cd2b5a72dca68160c2c1ff3b68 (diff)
allow tyui to format text
Diffstat (limited to 'teensy/teensy_ui.c')
-rw-r--r--teensy/teensy_ui.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/teensy/teensy_ui.c b/teensy/teensy_ui.c
index d9ce33b..662c487 100644
--- a/teensy/teensy_ui.c
+++ b/teensy/teensy_ui.c
@@ -1,6 +1,7 @@
#include "teensy_ui.h"
#include <assert.h>
+#include <stdarg.h>
#include "teensy_list.h"
@@ -287,8 +288,13 @@ void tyui_end_window(void)
uictx.active = &uictx.root;
}
-void tyui_text(const char *text)
+void tyui_text(const char *fmt, ...)
{
+ va_list args;
+ va_start(args, fmt);
+ char *text = ty_format_args(fmt, args);
+ va_end(args);
+
text_cmd(text, next_pos(TEXT_HEIGHT));
}