]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk1/tooltip.cpp
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxToolTip implementation
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
10 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
11 #pragma implementation "tooltip.h"
14 // For compilers that support precompilation, includes "wx.h".
15 #include "wx/wxprec.h"
21 #include "wx/tooltip.h"
22 #include "wx/window.h"
24 #include "wx/gtk/private.h"
26 //-----------------------------------------------------------------------------
28 //-----------------------------------------------------------------------------
30 static GtkTooltips
*ss_tooltips
= (GtkTooltips
*) NULL
;
32 //-----------------------------------------------------------------------------
34 //-----------------------------------------------------------------------------
36 IMPLEMENT_ABSTRACT_CLASS(wxToolTip
, wxObject
)
38 wxToolTip::wxToolTip( const wxString
&tip
)
41 m_window
= (wxWindow
*) NULL
;
44 void wxToolTip::SetTip( const wxString
&tip
)
50 void wxToolTip::Apply( wxWindow
*win
)
56 ss_tooltips
= gtk_tooltips_new();
62 m_window
->ApplyToolTip( ss_tooltips
, (wxChar
*) NULL
);
64 m_window
->ApplyToolTip( ss_tooltips
, m_text
);
67 void wxToolTip::Enable( bool flag
)
69 if (!ss_tooltips
) return;
72 gtk_tooltips_enable( ss_tooltips
);
74 gtk_tooltips_disable( ss_tooltips
);
77 void wxToolTip::SetDelay( long msecs
)
82 gtk_tooltips_set_delay( ss_tooltips
, (int)msecs
);