From 83ce88402ce3f68ae847f99e34221f15e242219c Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 1 Sep 2015 08:41:15 -0700 Subject: [PATCH] Add gtk_cell_renderer_set_padding() compatibility function --- include/wx/gtk/private/gtk2-compat.h | 7 +++++++ src/gtk/dataview.cpp | 9 +-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/wx/gtk/private/gtk2-compat.h b/include/wx/gtk/private/gtk2-compat.h index 9a7f79fb50..fcc2592578 100644 --- a/include/wx/gtk/private/gtk2-compat.h +++ b/include/wx/gtk/private/gtk2-compat.h @@ -193,6 +193,13 @@ static inline void wx_gtk_cell_renderer_get_padding(GtkCellRenderer* cell, gint* } #define gtk_cell_renderer_get_padding wx_gtk_cell_renderer_get_padding +static inline void wx_gtk_cell_renderer_set_padding(GtkCellRenderer* cell, gint xpad, gint ypad) +{ + cell->xpad = xpad; + cell->ypad = ypad; +} +#define gtk_cell_renderer_set_padding wx_gtk_cell_renderer_set_padding + static inline void wx_gtk_widget_get_allocation(GtkWidget* widget, GtkAllocation* allocation) { *allocation = widget->allocation; diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp index ec359bbe2c..5c87914177 100644 --- a/src/gtk/dataview.cpp +++ b/src/gtk/dataview.cpp @@ -2439,14 +2439,7 @@ void wxDataViewCustomRenderer::GtkInitTextRenderer() g_object_ref_sink(m_text_renderer); GtkApplyAlignment(GTK_CELL_RENDERER(m_text_renderer)); -#if GTK_CHECK_VERSION(2,18,0) -#ifndef __WXGTK3__ - if (gtk_check_version(2,18,0) == NULL) -#endif - { - gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(m_text_renderer), 0, 0); - } -#endif + gtk_cell_renderer_set_padding(GTK_CELL_RENDERER(m_text_renderer), 0, 0); } GtkCellRendererText *wxDataViewCustomRenderer::GtkGetTextRenderer() const