clean up wxGTK tooltip code

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67298 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Paul Cornett
2011-03-23 17:36:10 +00:00
parent 2a6545a5a7
commit 558a94bd4a
8 changed files with 34 additions and 94 deletions

View File

@@ -3778,33 +3778,20 @@ void wxWindowGTK::ClearBackground()
#if wxUSE_TOOLTIPS
void wxWindowGTK::DoSetToolTip( wxToolTip *tip )
{
wxWindowBase::DoSetToolTip(tip);
if (m_tooltip != tip)
{
wxWindowBase::DoSetToolTip(tip);
if (m_tooltip)
{
m_tooltip->GTKApply( (wxWindow *)this );
}
else
{
GtkWidget *w = GetConnectWidget();
wxToolTip::GTKApply(w, NULL);
if (m_tooltip)
m_tooltip->GTKSetWindow(static_cast<wxWindow*>(this));
else
GTKApplyToolTip(NULL);
}
}
void wxWindowGTK::GTKApplyToolTip( GtkTooltips *tips, const gchar *tip )
void wxWindowGTK::GTKApplyToolTip(const char* tip)
{
GtkWidget *w = GetConnectWidget();
#if GTK_CHECK_VERSION(2, 12, 0)
if (!gtk_check_version(2, 12, 0))
{
gtk_widget_set_tooltip_text (w, tip);
}
else
#endif
{
gtk_tooltips_set_tip(tips, w, tip, NULL);
}
wxToolTip::GTKApply(GetConnectWidget(), tip);
}
#endif // wxUSE_TOOLTIPS