ui/gtk/toolkit.h

branch
newapi
changeset 296
a362c76dbf99
parent 293
736c962f1011
child 298
c5e207d01ff2
equal deleted inserted replaced
295:35d6e9b5d4b3 296:a362c76dbf99
36 #ifdef __cplusplus 36 #ifdef __cplusplus
37 extern "C" { 37 extern "C" {
38 #endif 38 #endif
39 39
40 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 40 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
41
42
43 #if GTK_MAJOR_VERSION >= 4
44 #define WINDOW_SHOW(window) gtk_window_present(GTK_WINDOW(window))
45 #define WINDOW_DESTROY(window) gtk_window_destroy(GTK_WINDOW(window))
46 #define WINDOW_SET_CONTENT(window, child) gtk_window_set_child(GTK_WINDOW(window), child)
47 #define BOX_ADD(box, child) gtk_box_append(GTK_BOX(box), child)
48 #define ENTRY_GET_TEXT(entry) gtk_editable_get_text(GTK_EDITABLE(entry))
49 #else
50 #define WINDOW_SHOW(window) gtk_widget_show_all(window)
51 #define WINDOW_DESTROY(window) gtk_window_destroy(GTK_WINDOW(window))
52 #define WINDOW_SET_CONTENT(window, child) gtk_container_add(GTK_CONTAINER(window), child)
53 #define BOX_ADD(box, child) gtk_box_pack_end(GTK_BOX(box), child, TRUE, TRUE, 0)
54 #define ENTRY_GET_TEXT(entry) gtk_entry_get_text(GTK_EDITABLE(entry))
55 #endif
41 56
42 typedef struct UiEventData { 57 typedef struct UiEventData {
43 UiObject *obj; 58 UiObject *obj;
44 ui_callback callback; 59 ui_callback callback;
45 void *userdata; 60 void *userdata;

mercurial