From 3f7c3f01906ad7d6b1736a38bce5e58ccc357f68 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 13 Jun 2019 12:51:55 +0200 Subject: [PATCH] Don't implement wxStaticText::WX[SG]etVisibleLabel() in wxGTK These functions are never used in this port, so make it clear, both in the code and in the comment preceding them. --- src/gtk/stattext.cpp | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/gtk/stattext.cpp b/src/gtk/stattext.cpp index 067cf1294e..524b6d97b8 100644 --- a/src/gtk/stattext.cpp +++ b/src/gtk/stattext.cpp @@ -270,17 +270,23 @@ void wxStaticText::GTKWidgetDoSetMnemonic(GtkWidget* w) } -// These functions should be used only when GTK+ < 2.6 by wxStaticTextBase::UpdateLabel() +// These functions are not used as GTK supports ellipsization natively and we +// never call the base class UpdateText() which uses them. +// +// Note that, unfortunately, we still need to define them because they still +// exist, as pure virtuals, in the base class even in wxGTK to allow +// wxGenericStaticText to override them. wxString wxStaticText::WXGetVisibleLabel() const { - GtkLabel *label = GTK_LABEL(m_widget); - return wxGTK_CONV_BACK( gtk_label_get_text( label ) ); + wxFAIL_MSG(wxS("Unreachable")); + + return wxString(); } -void wxStaticText::WXSetVisibleLabel(const wxString& str) +void wxStaticText::WXSetVisibleLabel(const wxString& WXUNUSED(str)) { - GTKSetLabelForLabel(GTK_LABEL(m_widget), str); + wxFAIL_MSG(wxS("Unreachable")); } // static