ui/win32/button.c

changeset 113
dde28a806552
parent 112
c3f2f16fa4b8
equal deleted inserted replaced
112:c3f2f16fa4b8 113:dde28a806552
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;

mercurial