| 49 UiLayout layout = UI_ARGS2LAYOUT(args); |
49 UiLayout layout = UI_ARGS2LAYOUT(args); |
| 50 |
50 |
| 51 HWND hwnd = CreateWindow( |
51 HWND hwnd = CreateWindow( |
| 52 "BUTTON", |
52 "BUTTON", |
| 53 args->label, |
53 args->label, |
| 54 WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON, |
54 WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, |
| 55 0, 0, 100, 30, |
55 0, 0, 100, 30, |
| 56 parent, |
56 parent, |
| 57 (HMENU)0, |
57 (HMENU)1, |
| 58 hInstance, |
58 hInstance, |
| 59 NULL); |
59 NULL); |
| 60 ui_win32_set_ui_font(hwnd); |
60 ui_win32_set_ui_font(hwnd); |
| 61 |
61 |
| 62 W32Widget *widget = w32_widget_create(&button_widget_class, hwnd, sizeof(UiWidget)); |
62 W32Widget *widget = w32_widget_create(&button_widget_class, hwnd, sizeof(UiWidget)); |
| 83 } |
83 } |
| 84 |
84 |
| 85 void ui_button_eventproc(W32Widget *widget, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
85 void ui_button_eventproc(W32Widget *widget, HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { |
| 86 UiWidget *w = (UiWidget*)widget; |
86 UiWidget *w = (UiWidget*)widget; |
| 87 |
87 |
| |
88 printf("button eventproc\n"); |
| |
89 fflush(stdout); |
| |
90 |
| 88 UiEvent e; |
91 UiEvent e; |
| 89 e.obj = w->obj; |
92 e.obj = w->obj; |
| 90 e.document = e.obj->ctx->document; |
93 e.document = e.obj->ctx->document; |
| 91 e.window = e.obj->window; |
94 e.window = e.obj->window; |
| 92 e.eventdata = NULL; |
95 e.eventdata = NULL; |