diff -r 4a8b1a748f09 -r 5db4979bf482 make/vs/testapp/main.c --- a/make/vs/testapp/main.c Sun Sep 24 12:03:57 2023 +0200 +++ b/make/vs/testapp/main.c Sun Oct 01 09:23:47 2023 +0200 @@ -30,38 +30,30 @@ #include #include +#include #include void action1(UiEvent* event, void* data) { char* action = data; - printf("hello world!\n"); + printf("data: %s!\n", data); } void application_startup(UiEvent* event, void* data) { UiObject* obj = ui_window("Test", NULL); - /* - ui_button(obj, "Button1", action1, "action1"); - ui_button(obj, "Button2", action1, "action2"); - ui_layout_fill(obj, TRUE); - ui_button(obj, "Button3", action1, "action3"); - */ - UI_GRID_SP(obj, 10, 5, 20) { - ui_button(obj, "Button1", action1, "action1"); - ui_button(obj, "Button2", action1, "action2"); - ui_layout_hexpand(obj, 1); - ui_button(obj, "Button3", action1, "action3"); + ui_button(obj, .label="Button1", .onclick=action1, .onclickdata="action1"); + ui_button(obj, .label="Button2", .onclick=action1, .onclickdata="action2"); + ui_button(obj, .label="Button3", .onclick=action1, .onclickdata="action3", .hexpand=true); ui_newline(obj); - ui_button(obj, "Button4", action1, "action4"); - ui_layout_gridwidth(obj, 2); - ui_button(obj, "Button5_", action1, "action5"); + ui_button(obj, .label="Button4", .onclick=action1, .onclickdata="action4"); + ui_button(obj, .label="Button5", .onclick=action1, .onclickdata="action5", .colspan=2); ui_newline(obj); - ui_button(obj, "Very Long Button Label Text ____________ Test", action1, "test"); + ui_button(obj, .label="Very Long Button Label Text ____________ Test", .onclick=action1, .onclickdata="test"); } ui_show(obj);