ui/gtk/button.c

changeset 16
a499c8a72c15
parent 5
19d37cb9c96c
child 21
012418e7dc90
equal deleted inserted replaced
15:7a36f91c22f7 16:a499c8a72c15
42 obj->ctx->mempool, 42 obj->ctx->mempool,
43 sizeof(UiEventData)); 43 sizeof(UiEventData));
44 event->obj = obj; 44 event->obj = obj;
45 event->user_data = data; 45 event->user_data = data;
46 event->callback = f; 46 event->callback = f;
47 event->value = 0;
47 48
48 g_signal_connect( 49 g_signal_connect(
49 button, 50 button,
50 "clicked", 51 "clicked",
51 G_CALLBACK(ui_button_clicked), 52 G_CALLBACK(ui_button_clicked),
62 void ui_button_clicked(GtkWidget *widget, UiEventData *event) { 63 void ui_button_clicked(GtkWidget *widget, UiEventData *event) {
63 UiEvent e; 64 UiEvent e;
64 e.obj = event->obj; 65 e.obj = event->obj;
65 e.window = event->obj->window; 66 e.window = event->obj->window;
66 e.document = event->obj->document; 67 e.document = event->obj->document;
67 e.intval = 0; 68 e.eventdata = NULL;
69 e.intval = event->value;
68 event->callback(&e, event->user_data); 70 event->callback(&e, event->user_data);
69 } 71 }

mercurial