From df4e9e322dc8c64af1fc8aabc26c8d4ddab32574 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 11 Apr 2015 15:20:52 +0100 Subject: Add widget alignment gtk compatability interface. --- gtk/compat.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'gtk/compat.h') diff --git a/gtk/compat.h b/gtk/compat.h index 52d10f35e..d35c5d75f 100644 --- a/gtk/compat.h +++ b/gtk/compat.h @@ -69,6 +69,31 @@ #define NSGTK_STOCK_OPEN GTK_STOCK_OPEN #endif +/* widget alignment only available since 3.0 */ +#if !GTK_CHECK_VERSION(3,0,0) +typedef enum { + GTK_ALIGN_FILL, + GTK_ALIGN_START, + GTK_ALIGN_END, + GTK_ALIGN_CENTER, + GTK_ALIGN_BASELINE +} GtkAlign; +#endif + +/** + * Set the alignment of a widget. + * + * sets both the horizontal and vertical alignement of a widget + * + * @note this type of alignemnt was not available prior to GTK 3.0 so + * we emulate it using gtk_misc_set_alignment. + * + * \param widget The widget to set alignent on. + * \param halign The horizontal alignment to set. + * \param valign The vertical alignment to set + */ +void nsgtk_widget_set_alignment(GtkWidget *widget, GtkAlign halign, GtkAlign valign); + void nsgtk_widget_set_can_focus(GtkWidget *widget, gboolean can_focus); gboolean nsgtk_widget_has_focus(GtkWidget *widget); gboolean nsgtk_widget_get_visible(GtkWidget *widget); -- cgit v1.2.3