From db9baf9aa5565a7a4f92097b2f0c85439c35b4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sat, 15 Aug 2015 18:54:02 +0200 Subject: [PATCH] Only set native label if nonempty in wxWindowMac::SetPeer() Some native controls don't take kindly to being set setStringValue: with a value invalid for the control (such as empty string for NSPathControl). Don't do this if the label is empty anyway to avoid problems with wxNativeWindow when the underlying native control is like that. --- src/osx/window_osx.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index b50b3922de..e707143be3 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -357,7 +357,8 @@ void wxWindowMac::SetPeer(wxOSXWidgetImpl* peer) if ( !m_hasFont ) DoSetWindowVariant( m_windowVariant ); - GetPeer()->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ; + if ( !m_label.empty() ) + GetPeer()->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ; // for controls we want to use best size for wxDefaultSize params ) if ( !GetPeer()->IsUserPane() )