application/main.c

branch
newapi
changeset 388
473c03f85197
parent 383
03599608d555
child 389
d15eca5fd8b3
--- a/application/main.c	Sun Nov 17 15:21:50 2024 +0100
+++ b/application/main.c	Thu Nov 21 12:04:53 2024 +0100
@@ -369,6 +369,23 @@
         ui_menuitem(.label = "Test");
     }
     
+    UiMenuBuilder *menubuilder;
+    ui_contextmenu(&menubuilder) {
+        ui_menuitem(.label = "Context Item 1");
+        ui_menuitem(.label = "Context Item 2");
+        ui_menu("Context Submenu") {
+            ui_menuitem(.label = "Context Sub Item");
+        }
+    }
+    
+    ui_menu("Edit") {
+        ui_menuitem(.label = "Undo");
+        ui_menuseparator();
+        ui_menu("Submenu") {
+            ui_menuitem(.label = "Subitem");
+        }
+    }
+    
     ui_toolbar_item("Test", .label = "Test", .onclick = action_toolbar_button);
     ui_toolbar_item("Test2", .label = "New Window", .onclick = action_toolbar_newwindow);
     ui_toolbar_item("Test3", .label = "Dialog", .onclick = action_toolbar_dialog);

mercurial