From 81cc3dae659630a090fd711111b309037d64dec9 Mon Sep 17 00:00:00 2001 From: Alessandro Mauri Date: Fri, 12 Sep 2025 22:45:23 +0200 Subject: [PATCH] div_end returns the div Id --- lib/ugui.c3l/src/widgets/ugui_div.c3 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ugui.c3l/src/widgets/ugui_div.c3 b/lib/ugui.c3l/src/widgets/ugui_div.c3 index 6d4985b..2630f37 100644 --- a/lib/ugui.c3l/src/widgets/ugui_div.c3 +++ b/lib/ugui.c3l/src/widgets/ugui_div.c3 @@ -32,7 +32,7 @@ macro Ctx.@div(&ctx, { ctx.div_begin(width, height, dir, anchor, scroll_x, scroll_y, $vasplat)!; @body(); - ctx.div_end()!; + return ctx.div_end()!; } macro Ctx.div_begin(&ctx, @@ -92,7 +92,7 @@ fn void? Ctx.div_begin_id(&ctx, // TODO: check resizeable } -fn void? Ctx.div_end(&ctx) +fn Id? Ctx.div_end(&ctx) { Elem* elem = ctx.get_active_div()!; @@ -136,4 +136,6 @@ fn void? Ctx.div_end(&ctx) ctx.reset_scissor(elem.div.z_index)!; update_parent_size(elem, parent); + + return elem.id; }