(trunk gtk) add portability wrapper for gtk_widget_get_realized() in gtk+ < 2.20

This commit is contained in:
Charles Kerr 2010-06-26 16:07:15 +00:00
parent 01a10a2b6e
commit f097e05d7b
3 changed files with 15 additions and 1 deletions

View File

@ -888,7 +888,7 @@ tr_window_get_selection( TrWindow * w )
void
tr_window_set_busy( TrWindow * w, gboolean isBusy )
{
if( w && gtk_widget_get_realized( GTK_WIDGET( w ) ) )
if( w && gtr_widget_get_realized( GTK_WIDGET( w ) ) )
{
GdkDisplay * display = gtk_widget_get_display( GTK_WIDGET( w ) );
GdkCursor * cursor = isBusy ? gdk_cursor_new_for_display( display, GDK_WATCH ) : NULL;

View File

@ -716,6 +716,16 @@ gtr_widget_set_tooltip_text( GtkWidget * w, const char * tip )
#endif
}
gboolean
gtr_widget_get_realized( GtkWidget * w )
{
#if GTK_CHECK_VERSION( 2,20,0 )
return gtk_widget_get_realized( w );
#else
return GTK_WIDGET_REALIZED( w ) != 0;
#endif
}
void
gtr_toolbar_set_orientation( GtkToolbar * toolbar,
GtkOrientation orientation )
@ -727,6 +737,7 @@ gtr_toolbar_set_orientation( GtkToolbar * toolbar,
#endif
}
/***
****
***/

View File

@ -128,6 +128,9 @@ void gtr_toolbar_set_orientation( GtkToolbar * tb, GtkOrientation orientation );
/* backwards-compatible wrapper around gtk_widget_set_tooltip_text() */
void gtr_widget_set_tooltip_text( GtkWidget * w, const char * tip );
/* backwards-compatible wrapper around gtk_widget_get_realized() */
gboolean gtr_widget_get_realized( GtkWidget * w );
/* backwards-compatible wrapper around g_object_ref_sink() */
gpointer gtr_object_ref_sink( gpointer object );