]>
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"
18 #include "wx/window.h"
21 #include "wx/gtk/private.h"
23 //-----------------------------------------------------------------------------
25 //-----------------------------------------------------------------------------
27 static GtkTooltips
*gs_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 gs_tooltips
= gtk_tooltips_new();
58 m_window
->ApplyToolTip( gs_tooltips
, (wxChar
*) NULL
);
60 m_window
->ApplyToolTip( gs_tooltips
, m_text
);
64 void wxToolTip::Apply(GtkWidget
*w
, const wxCharBuffer
& tip
)
67 gs_tooltips
= gtk_tooltips_new();
69 gtk_tooltips_set_tip(gs_tooltips
, w
, tip
, NULL
);
72 void wxToolTip::Enable( bool flag
)
78 gtk_tooltips_enable( gs_tooltips
);
80 gtk_tooltips_disable( gs_tooltips
);
84 void gtk_tooltips_set_delay (GtkTooltips
*tooltips
,
88 void wxToolTip::SetDelay( long msecs
)
93 // FIXME: This is a deprecated function and might not even have an effect.
94 // Try to not use it, after which remove the prototype above.
95 gtk_tooltips_set_delay( gs_tooltips
, (int)msecs
);
98 #endif // wxUSE_TOOLTIPS