From 7e1e3304639eeb47965187cd9d7a745f5887780d Mon Sep 17 00:00:00 2001 From: radius Date: Sun, 28 Feb 2016 23:42:39 -0500 Subject: [PATCH] add context menu to demo window --- menu/drivers/zr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/menu/drivers/zr.c b/menu/drivers/zr.c index 5203a0dc29..279f6bf566 100644 --- a/menu/drivers/zr.c +++ b/menu/drivers/zr.c @@ -484,6 +484,18 @@ static void zrmenu_wnd_demo(struct zr_context *ctx, int width, int height, struc if (old != gui->theme) zrmenu_set_style(ctx, gui->theme); zr_combo_end(ctx); } + + struct zr_panel node, menu; + + /* context menu */ + if (zr_contextual_begin(ctx, &menu, 0, zr_vec2(100, 220), zr_window_get_bounds(ctx))) { + zr_layout_row_dynamic(ctx, 25, 1); + if (zr_contextual_item(ctx, "Test 1", ZR_TEXT_CENTERED)) + printf("test \n"); + if (zr_contextual_item(ctx, "Test 2",ZR_TEXT_CENTERED)) + printf("test \n"); + zr_contextual_end(ctx); + } } zr_end(ctx); }