From 5e51600cfe713fa320734291ec15a7a584c1c25b Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sat, 11 Apr 2015 18:41:00 +0100 Subject: Add gtk compatability for margin setting. --- gtk/compat.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gtk/compat.c') diff --git a/gtk/compat.c b/gtk/compat.c index 8484c02fd..0717f5260 100644 --- a/gtk/compat.c +++ b/gtk/compat.c @@ -583,3 +583,16 @@ void nsgtk_widget_set_alignment(GtkWidget *widget, GtkAlign halign, GtkAlign val gtk_misc_set_alignment(GTK_MISC(widget), x, y); #endif } + +/* exported interface documented in gtk/compat.h */ +void nsgtk_widget_set_margins(GtkWidget *widget, gint hmargin, gint vmargin) +{ +#if GTK_CHECK_VERSION(3,0,0) + gtk_widget_set_margin_left(widget, hmargin); + gtk_widget_set_margin_right(widget, hmargin); + gtk_widget_set_margin_top(widget, vmargin); + gtk_widget_set_margin_bottom(widget, vmargin); +#else + gtk_misc_set_padding(GTK_MISC(widget), hmargin, vmargin); +#endif +} -- cgit v1.2.3