X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d33704ddf2884c8b1cf1178e3cee6d2e1b4004f0..a84f5f39b8ab2fb7bbe98891a9ffe84af12287da:/src/gtk/radiobox.cpp?ds=sidebyside diff --git a/src/gtk/radiobox.cpp b/src/gtk/radiobox.cpp index 4a31911ff7..fc86bc36c5 100644 --- a/src/gtk/radiobox.cpp +++ b/src/gtk/radiobox.cpp @@ -16,10 +16,13 @@ #ifndef WX_PRECOMP #include "wx/log.h" + #include "wx/frame.h" + #include "wx/dialog.h" #endif -#include "wx/dialog.h" -#include "wx/frame.h" +#if wxUSE_TOOLTIPS + #include "wx/tooltip.h" +#endif #include "wx/gtk/private.h" #include @@ -558,16 +561,33 @@ void wxRadioBox::GTKWidgetDoSetMnemonic(GtkWidget* w) } #if wxUSE_TOOLTIPS -void wxRadioBox::ApplyToolTip( GtkTooltips *tips, const wxChar *tip ) +void wxRadioBox::ApplyToolTip(GtkTooltips * WXUNUSED(tips), const wxChar *tip) { - wxList::compatibility_iterator node = m_buttons.GetFirst(); - while (node) + // set this tooltip for all radiobuttons which don't have their own tips + unsigned n = 0; + for ( wxList::compatibility_iterator node = m_buttons.GetFirst(); + node; + node = node->GetNext(), n++ ) { - GtkWidget *widget = GTK_WIDGET( node->GetData() ); - gtk_tooltips_set_tip( tips, widget, wxConvCurrent->cWX2MB(tip), (gchar*) NULL ); - node = node->GetNext(); + if ( !GetItemToolTip(n) ) + { + wxToolTip::Apply(GTK_WIDGET(node->GetData()), + wxConvCurrent->cWX2MB(tip)); + } } } + +void wxRadioBox::DoSetItemToolTip(unsigned int n, wxToolTip *tooltip) +{ + wxCharBuffer buf; + if ( !tooltip ) + tooltip = GetToolTip(); + if ( tooltip ) + buf = wxGTK_CONV(tooltip->GetTip()); + + wxToolTip::Apply(GTK_WIDGET(m_buttons[n]), buf); +} + #endif // wxUSE_TOOLTIPS bool wxRadioBox::IsOwnGtkWindow( GdkWindow *window )