From 0cc5b6e97ecd175b9310460e68ed6d0408e4d7d6 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 15 Mar 2017 13:38:37 +0100 Subject: [PATCH] Fix wxGTK build in non-Unicode mode Use wxGTK_CONV_FONT() and wxGTK_CONV_BACK_FONT() macros instead of implicitly using "m_font" which doesn't exist in wxTextEntry, which is not a wxWindow. --- src/gtk/textentry.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gtk/textentry.cpp b/src/gtk/textentry.cpp index af7972d697..7be2929d2d 100644 --- a/src/gtk/textentry.cpp +++ b/src/gtk/textentry.cpp @@ -574,7 +574,11 @@ bool wxTextEntry::SetHint(const wxString& hint) GtkEntry *entry = GetEntry(); if (entry && gtk_check_version(3,2,0) == NULL) { - gtk_entry_set_placeholder_text(entry, wxGTK_CONV(hint)); + gtk_entry_set_placeholder_text + ( + entry, + wxGTK_CONV_FONT(hint, GetEditableWindow()->GetFont()) + ); return true; } #endif @@ -586,7 +590,13 @@ wxString wxTextEntry::GetHint() const #if GTK_CHECK_VERSION(3,2,0) GtkEntry *entry = GetEntry(); if (entry && gtk_check_version(3,2,0) == NULL) - return wxGTK_CONV_BACK(gtk_entry_get_placeholder_text(entry)); + { + return wxGTK_CONV_BACK_FONT + ( + gtk_entry_get_placeholder_text(entry), + const_cast(this)->GetEditableWindow()->GetFont() + ); + } #endif return wxTextEntryBase::GetHint(); }