]> Pileus Git - grits/blobdiff - src/compat.h
Add support for GTK 3
[grits] / src / compat.h
diff --git a/src/compat.h b/src/compat.h
new file mode 100644 (file)
index 0000000..2e8b4e6
--- /dev/null
@@ -0,0 +1,10 @@
+#include <gtk/gtk.h>
+
+#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);
+}
+#endif