Add compatibility code for Gtk+ < 2.14

This commit is contained in:
Pierre Pronchery 2018-02-05 02:22:16 +01:00
parent 4ca8180033
commit f879140893
2 changed files with 15 additions and 0 deletions

View File

@ -148,6 +148,10 @@ GtkWidget * gtk_separator_new(GtkOrientation orientation);
GtkAllocation gtk_widget_get_allocation(GtkWidget * widget);
# endif
# if !GTK_CHECK_VERSION(2, 14, 0)
GdkWindow * gtk_widget_get_window(GtkWidget * widget);
# endif
# if !GTK_CHECK_VERSION(2, 12, 0)
void gtk_widget_set_tooltip_text(GtkWidget * widget, const gchar * text);
# endif

View File

@ -146,6 +146,17 @@ GtkAllocation gtk_widget_get_allocation(GtkWidget * widget)
# endif
# if !GTK_CHECK_VERSION(2, 14, 0)
/* gtk_widget_get_window */
GdkWindow * gtk_widget_get_window(GtkWidget * widget)
{
if(!gtk_widget_is_realized(widget))
return NULL;
return widget->window;
}
# endif
# if !GTK_CHECK_VERSION(2, 12, 0)
/* gtk_widget_set_tooltip_text */
void gtk_widget_set_tooltip_text(GtkWidget * widget, const gchar * text)