From 6e946200a271a80f883bc4fc61d33dcbbead9856 Mon Sep 17 00:00:00 2001 From: Timerix Date: Fri, 9 Jan 2026 06:06:01 +0500 Subject: [PATCH] TimKey return type --- include/tim.h | 2 +- src/edit.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/include/tim.h b/include/tim.h index 89e72df..0bc3c71 100644 --- a/include/tim.h +++ b/include/tim.h @@ -245,7 +245,7 @@ bool tim_radiobutton(cstr txt, i32* state, i32 v, i32 x, i32 y, i32 w, u64 color /// @param e persistent edit state, use TimEditState_init() to create new state /// @param color frame, background, text /// @return key id or 0 -i32 tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color); +TimKey tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color); void TimEditState_init(TimEditState* e, i32 capacity, cstr initial_content); diff --git a/src/edit.c b/src/edit.c index 1077f6c..7b0a8a1 100755 --- a/src/edit.c +++ b/src/edit.c @@ -36,7 +36,7 @@ void TimEditState_delete(TimEditState* e) { } /// @return key id or 0 -static i32 edit_event(TimEditState* e, TimRect r) { +static TimKey edit_event(TimEditState* e, TimRect r) { if (tim_is_mouse_click_over(r)) { // take focus tim->focus = e; @@ -85,7 +85,7 @@ static i32 edit_event(TimEditState* e, TimRect r) { return tim->event.key; } -i32 tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color) { +TimKey tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color) { TimRect r = tim_scope_rect_to_absolute(x, y, w, 3); if (tim->event.type == TimEvent_Draw) {