| 1133 |
1133 |
| 1134 #endif |
1134 #endif |
| 1135 |
1135 |
| 1136 #ifdef UI_WIN32 |
1136 #ifdef UI_WIN32 |
| 1137 |
1137 |
| |
1138 static void action_button(UiEvent *event, void *data) { |
| |
1139 printf("button clicked\n"); |
| |
1140 } |
| |
1141 |
| 1138 void application_startup(UiEvent *event, void *data) { |
1142 void application_startup(UiEvent *event, void *data) { |
| 1139 UiObject *obj = ui_window("Test w32", NULL); |
1143 UiObject *obj = ui_window("Test w32", NULL); |
| 1140 ui_button(obj, .label = "Test", .hfill = TRUE, .hexpand = TRUE, .colspan = 3, .margin = 10); |
1144 ui_button(obj, .label = "Test", .hfill = TRUE, .hexpand = TRUE, .colspan = 3, .margin = 10); |
| 1141 ui_button(obj, .label = "Test 2-1", .margin_left = 10); |
1145 ui_button(obj, .label = "Test 2-1", .margin_left = 10); |
| 1142 ui_button(obj, .label = "Test 2-2", .hfill = TRUE, .hexpand = TRUE, .margin_left = 20); |
1146 ui_button(obj, .label = "Test 2-2", .hfill = TRUE, .hexpand = TRUE, .margin_left = 20); |
| 1143 ui_button(obj, .label = "Test 2-3", .margin_left = 30); |
1147 ui_button(obj, .label = "Test 2-3", .margin_left = 30); |
| 1144 ui_button(obj, .label = "Test 3XX", .colspan = 3, .fill = TRUE); |
1148 ui_button(obj, .label = "Test 3XX", .colspan = 3, .fill = TRUE, .onclick = action_button); |
| 1145 ui_show(obj); |
1149 ui_show(obj); |
| 1146 } |
1150 } |
| 1147 |
1151 |
| 1148 int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { |
1152 int WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { |
| 1149 ui_init("app1", 0, NULL); |
1153 ui_init("app1", 0, NULL); |