X-Git-Url: http://pileus.org/git/?p=aweather;a=blobdiff_plain;f=src%2Fcompat.h;fp=src%2Fcompat.h;h=3d530f6bef56546a3069ee71a50da30048286339;hp=0000000000000000000000000000000000000000;hb=9e734911e96ae83b0f41afa5073d5313bc197d96;hpb=7c1875120499d15fd82d9ed49f934734852bb9c3 diff --git a/src/compat.h b/src/compat.h new file mode 100644 index 0000000..3d530f6 --- /dev/null +++ b/src/compat.h @@ -0,0 +1,17 @@ +#include + +#if ! GTK_CHECK_VERSION(3,0,0) +static inline GtkWidget *gtk_box_new(GtkOrientation orientation, gint spacing) +{ + return orientation == GTK_ORIENTATION_HORIZONTAL + ? gtk_hbox_new(0, spacing) + : gtk_vbox_new(0, spacing); +} +static inline GtkWidget *gtk_scale_new_with_range(GtkOrientation orientation, + gdouble min, gdouble max, gdouble step) +{ + return orientation == GTK_ORIENTATION_HORIZONTAL + ? gtk_hscale_new_with_range(min, max, step) + : gtk_vscale_new_with_range(min, max, step); +} +#endif