diff --git a/interface/wx/window.h b/interface/wx/window.h index 73b300c789..7d1f81473c 100644 --- a/interface/wx/window.h +++ b/interface/wx/window.h @@ -2216,6 +2216,11 @@ public: */ wxToolTip* GetToolTip() const; + /** + Get the text of the associated tooltip or empty string if none. + */ + wxString GetToolTipText() const; + /** Attach a tooltip to the window. diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 6eddc7acf4..b337a659e4 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -1878,6 +1878,11 @@ void wxWindowBase::OnHelp(wxHelpEvent& event) #if wxUSE_TOOLTIPS +wxString wxWindowBase::GetToolTipText() const +{ + return m_tooltip ? m_tooltip->GetTip() : wxString(); +} + void wxWindowBase::SetToolTip( const wxString &tip ) { // don't create the new tooltip if we already have one