Don't set initial label in wxNativeWindow on OS X

Differentiate between setting the label from SetLabel() and from
SetPeer() (i.e. initially), because some native controls shouldn't have
an empty string set as their intitial value.

Override SetInitialSize() to be empty for wxNativeWindow in order to
prevent label-setting issues when an unknown, caller-controlled native
widget is attached. Reverts db9baf9aa5,
which was the previous attempt to fix this, but was causing too many
problems elsewhere.
This commit is contained in:
Václav Slavík
2016-04-29 17:26:02 +02:00
parent 77939b4b62
commit 98f5315405
3 changed files with 25 additions and 3 deletions

View File

@@ -353,8 +353,7 @@ void wxWindowMac::SetPeer(wxOSXWidgetImpl* peer)
if ( !m_hasFont )
DoSetWindowVariant( m_windowVariant );
if ( !m_label.empty() )
GetPeer()->SetLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ;
GetPeer()->SetInitialLabel( wxStripMenuCodes(m_label, wxStrip_Mnemonics), GetFont().GetEncoding() ) ;
// for controls we want to use best size for wxDefaultSize params )
if ( !GetPeer()->IsUserPane() )