]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/tooltip.cpp
wxMessageBox off the main thread lost result code.
[wxWidgets.git] / src / gtk / tooltip.cpp
index ffcb59d4c1b9aab0a1647c85729126b1d748b171..338b9a150c6d8735683581fe3efdd6262c54cf34 100644 (file)
@@ -2,7 +2,6 @@
 // Name:        src/gtk/tooltip.cpp
 // Purpose:     wxToolTip implementation
 // Author:      Robert Roebling
-// Id:          $Id$
 // Copyright:   (c) 1998 Robert Roebling
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -24,7 +23,9 @@
 // global data
 //-----------------------------------------------------------------------------
 
+#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
 static GtkTooltips *gs_tooltips = NULL;
+#endif
 
 //-----------------------------------------------------------------------------
 // wxToolTip
@@ -56,22 +57,24 @@ void wxToolTip::GTKSetWindow(wxWindow* win)
 void wxToolTip::GTKApply(GtkWidget* widget, const char* tip)
 {
 #if GTK_CHECK_VERSION(2, 12, 0)
-    if (!gtk_check_version(2, 12, 0))
+    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
         gtk_widget_set_tooltip_text(widget, tip);
     else
 #endif
     {
+#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
         if ( !gs_tooltips )
             gs_tooltips = gtk_tooltips_new();
 
         gtk_tooltips_set_tip(gs_tooltips, widget, tip, NULL);
+#endif
     }
 }
 
 void wxToolTip::Enable( bool flag )
 {
 #if GTK_CHECK_VERSION(2, 12, 0)
-    if (!gtk_check_version(2, 12, 0))
+    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
     {
         GtkSettings* settings = gtk_settings_get_default();
         if (settings)
@@ -80,6 +83,7 @@ void wxToolTip::Enable( bool flag )
     else
 #endif
     {
+#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
         if (!gs_tooltips)
             gs_tooltips = gtk_tooltips_new();
 
@@ -87,13 +91,14 @@ void wxToolTip::Enable( bool flag )
             gtk_tooltips_enable( gs_tooltips );
         else
             gtk_tooltips_disable( gs_tooltips );
+#endif
     }
 }
 
 void wxToolTip::SetDelay( long msecs )
 {
 #if GTK_CHECK_VERSION(2, 12, 0)
-    if (!gtk_check_version(2, 12, 0))
+    if (GTK_CHECK_VERSION(3,0,0) || gtk_check_version(2,12,0) == NULL)
     {
         GtkSettings* settings = gtk_settings_get_default();
         if (settings)
@@ -102,10 +107,12 @@ void wxToolTip::SetDelay( long msecs )
     else
 #endif
     {
+#if !GTK_CHECK_VERSION(3,0,0) && !defined(GTK_DISABLE_DEPRECATED)
         if (!gs_tooltips)
             gs_tooltips = gtk_tooltips_new();
 
         gtk_tooltips_set_delay( gs_tooltips, (int)msecs );
+#endif
     }
 }