]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/tooltip.cpp
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"
16 #include "wx/window.h"
18 #include "wx/gtk/private.h"
20 //-----------------------------------------------------------------------------
22 //-----------------------------------------------------------------------------
24 static GtkTooltips
*ss_tooltips
= (GtkTooltips
*) NULL
;
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 IMPLEMENT_ABSTRACT_CLASS(wxToolTip
, wxObject
)
32 wxToolTip::wxToolTip( const wxString
&tip
)
35 m_window
= (wxWindow
*) NULL
;
38 void wxToolTip::SetTip( const wxString
&tip
)
44 void wxToolTip::Apply( wxWindow
*win
)
50 ss_tooltips
= gtk_tooltips_new();
56 m_window
->ApplyToolTip( ss_tooltips
, (wxChar
*) NULL
);
58 m_window
->ApplyToolTip( ss_tooltips
, m_text
);
61 void wxToolTip::Enable( bool flag
)
63 if (!ss_tooltips
) return;
66 gtk_tooltips_enable( ss_tooltips
);
68 gtk_tooltips_disable( ss_tooltips
);
72 void gtk_tooltips_set_delay (GtkTooltips
*tooltips
,
76 void wxToolTip::SetDelay( long msecs
)
81 // FIXME: This is a deprecated function and might not even have an effect.
82 // Try to not use it, after which remove the prototype above.
83 gtk_tooltips_set_delay( ss_tooltips
, (int)msecs
);