add macro for creating the appmenu toolbar item newapi

Sun, 28 Jan 2024 17:10:30 +0100

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sun, 28 Jan 2024 17:10:30 +0100
branch
newapi
changeset 233
84665f0a9ab2
parent 232
e2b33055113f
child 234
9036b346cd66

add macro for creating the appmenu toolbar item

ui/ui/toolbar.h file | annotate | diff | comparison | revisions
--- a/ui/ui/toolbar.h	Sun Jan 28 11:42:42 2024 +0100
+++ b/ui/ui/toolbar.h	Sun Jan 28 17:10:30 2024 +0100
@@ -70,7 +70,8 @@
 #define ui_toolbar_item(name, ...) ui_toolbar_item_create(name, (UiToolbarItemArgs){ __VA_ARGS__ } )
 #define ui_toolbar_toggleitem(name, ...) ui_toolbar_toggleitem_create(name, (UiToolbarToggleItemArgs){ __VA_ARGS__ } )
 
-#define ui_toolbar_menu(obj, ...) for(ui_toolbar_menu_create(obj, (UiToolbarMenuArgs){ __VA_ARGS__ });ui_menu_is_open();ui_menu_close())
+#define ui_toolbar_menu(name, ...) for(ui_toolbar_menu_create(name, (UiToolbarMenuArgs){ __VA_ARGS__ });ui_menu_is_open();ui_menu_close())
+#define ui_toolbar_appmenu() for(ui_toolbar_menu_create(NULL, (UiToolbarMenuArgs){ 0 });ui_menu_is_open();ui_menu_close())
 
 
 UIEXPORT void ui_toolbar_item_create(const char* name, UiToolbarItemArgs args);

mercurial