ui/gtk/range.c

changeset 44
473954dc6b74
parent 32
e5f4d8af567e
equal deleted inserted replaced
43:ef01d2c90128 44:473954dc6b74
34 #include "../common/context.h" 34 #include "../common/context.h"
35 #include "../common/object.h" 35 #include "../common/object.h"
36 36
37 37
38 static UIWIDGET ui_scrollbar(UiObject *obj, UiOrientation orientation, UiRange *range, ui_callback f, void *userdata) { 38 static UIWIDGET ui_scrollbar(UiObject *obj, UiOrientation orientation, UiRange *range, ui_callback f, void *userdata) {
39 #ifdef UI_GTK3 39 #if GTK_MAJOR_VERSION >= 3
40 GtkWidget *scrollbar = gtk_scrollbar_new(orientation == UI_HORIZONTAL ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, NULL); 40 GtkWidget *scrollbar = gtk_scrollbar_new(orientation == UI_HORIZONTAL ? GTK_ORIENTATION_HORIZONTAL : GTK_ORIENTATION_VERTICAL, NULL);
41 #else 41 #else
42 GtkWidget *scrollbar; 42 GtkWidget *scrollbar;
43 if(orientation == UI_HORIZONTAL) { 43 if(orientation == UI_HORIZONTAL) {
44 scrollbar = gtk_hscrollbar_new(NULL); 44 scrollbar = gtk_hscrollbar_new(NULL);
122 #ifdef UI_GTK2LEGACY 122 #ifdef UI_GTK2LEGACY
123 a->page_size = extent; 123 a->page_size = extent;
124 #else 124 #else
125 gtk_adjustment_set_page_size(a, extent); 125 gtk_adjustment_set_page_size(a, extent);
126 #endif 126 #endif
127 #if !(GTK_MAJOR_VERSION >= 3 && GTK_MINOR_VERSION >= 18) 127 #if GTK_MAJOR_VERSION * 100 + GTK_MIMOR_VERSION < 318
128 gtk_adjustment_changed(a); 128 gtk_adjustment_changed(a);
129 #endif 129 #endif
130 range->extent = extent; 130 range->extent = extent;
131 } 131 }

mercurial