]>
git.saurik.com Git - wxWidgets.git/blob - src/gtk/tooltip.cpp
44759110bfc0c378c24c95b2c768984740e40f5d
1 /////////////////////////////////////////////////////////////////////////////
4 // Author: Robert Roebling
6 // Copyright: (c) 1998 Robert Roebling
7 // Licence: wxWindows licence
8 /////////////////////////////////////////////////////////////////////////////
11 #pragma implementation "tooltip.h"
14 #include "wx/tooltip.h"
19 //-----------------------------------------------------------------------------
21 //-----------------------------------------------------------------------------
23 static GtkTooltips
*ss_tooltips
= (GtkTooltips
*) NULL
;
24 static GdkColor ss_bg
;
25 static GdkColor ss_fg
;
27 //-----------------------------------------------------------------------------
29 //-----------------------------------------------------------------------------
31 wxToolTip::wxToolTip( const wxString
&tip
)
34 m_window
= (wxWindow
*) NULL
;
37 bool wxToolTip::Ok() const
42 wxString
wxToolTip::GetTip() const
47 void wxToolTip::SetTip( const wxString
&tip
)
53 void wxToolTip::Apply( wxWindow
*win
)
59 ss_tooltips
= gtk_tooltips_new();
64 gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_fg
);
69 gdk_color_alloc( gtk_widget_get_default_colormap(), &ss_bg
);
71 gtk_tooltips_set_colors( ss_tooltips
, &ss_bg
, &ss_fg
);
77 m_window
->ApplyToolTip( ss_tooltips
, (char*) NULL
);
79 m_window
->ApplyToolTip( ss_tooltips
, m_text
);
82 void wxToolTip::Enable( bool flag
)
84 if (!ss_tooltips
) return;
87 gtk_tooltips_enable( ss_tooltips
);
89 gtk_tooltips_disable( ss_tooltips
);
92 void wxToolTip::SetDelay( long msecs
)
94 if (!ss_tooltips
) return;
96 gtk_tooltips_set_delay( ss_tooltips
, msecs
);