]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/tooltip.cpp
bce18195c1841891952310827d253216fbd17738
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: src/gtk/tooltip.cpp
3 // Purpose: wxToolTip implementation
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 // For compilers that support precompilation, includes "wx.h".
11 #include "wx/wxprec.h"
15 #include "wx/tooltip.h"
18 #include "wx/window.h"
21 #include "wx/gtk/private.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 static GtkTooltips
*ss_tooltips
= (GtkTooltips
*) NULL
;
29 //-----------------------------------------------------------------------------
31 //-----------------------------------------------------------------------------
33 IMPLEMENT_ABSTRACT_CLASS(wxToolTip
, wxObject
)
35 wxToolTip::wxToolTip( const wxString
&tip
)
38 m_window
= (wxWindow
*) NULL
;
41 void wxToolTip::SetTip( const wxString
&tip
)
47 void wxToolTip::Apply( wxWindow
*win
)
53 ss_tooltips
= gtk_tooltips_new();
59 m_window
->ApplyToolTip( ss_tooltips
, (wxChar
*) NULL
);
61 m_window
->ApplyToolTip( ss_tooltips
, m_text
);
64 void wxToolTip::Enable( bool flag
)
66 if (!ss_tooltips
) return;
69 gtk_tooltips_enable( ss_tooltips
);
71 gtk_tooltips_disable( ss_tooltips
);
75 void gtk_tooltips_set_delay (GtkTooltips
*tooltips
,
79 void wxToolTip::SetDelay( long msecs
)
84 // FIXME: This is a deprecated function and might not even have an effect.
85 // Try to not use it, after which remove the prototype above.
86 gtk_tooltips_set_delay( ss_tooltips
, (int)msecs
);
89 #endif // wxUSE_TOOLTIPS