diff -r 9e2aee097b69 -r 132c7bcc6997 application/main.c --- a/application/main.c Sun Mar 31 09:58:07 2024 +0200 +++ b/application/main.c Sun Mar 31 16:19:01 2024 +0200 @@ -38,6 +38,7 @@ UiString *str2; UiDouble *progress; UiList *list; + UiInteger *radio; } MyDocument; MyDocument *doc1; @@ -56,6 +57,9 @@ } +void action_toolbar_button(UiEvent *event, void *userdata) { + +} MyDocument* create_doc(void) { MyDocument *doc = ui_document_new(sizeof(MyDocument)); @@ -67,6 +71,7 @@ ui_list_append(doc->list, "test1"); ui_list_append(doc->list, "test2"); ui_list_append(doc->list, "test3"); + doc->radio = ui_int_new(docctx, "radio"); return doc; } @@ -121,6 +126,13 @@ //UiModel *model = ui_model(obj->ctx, UI_ICON_TEXT, "Col 1", UI_STRING, "Col 2", -1); //model->getvalue = list_getvalue; ui_combobox(obj, .hexpand = true, .vexpand = false, .colspan = 2, .varname = "list", .getvalue = list_getvalue); + ui_newline(obj); + + ui_hbox0(obj) { + ui_radiobutton(obj, .label = "Radio 1", .varname = "radio"); + ui_radiobutton(obj, .label = "Radio 2", .varname = "radio"); + ui_radiobutton(obj, .label = "Radio 3", .varname = "radio"); + } } ui_show(obj); @@ -135,7 +147,18 @@ ui_menuitem(.label = "Test"); } - + ui_toolbar_item("Test", .label = "Test", .icon = "terminal", .onclick = action_toolbar_button); + ui_toolbar_toggleitem("Toggle", .label = "Toggle", .onchange = action_toolbar_button); + ui_toolbar_menu("Menu", .label = "Menu") { + ui_menuitem("Secondary Test", NULL, NULL); + ui_menu("Secondary Sub") { + ui_menuitem("Secondary subitem", NULL, NULL); + } + } + + ui_toolbar_add_default("Test", UI_TOOLBAR_LEFT); + ui_toolbar_add_default("Toggle", UI_TOOLBAR_LEFT); + ui_toolbar_add_default("Menu", UI_TOOLBAR_LEFT); ui_main();