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.
This commit is contained in:
parent
e691cfe83d
commit
db9baf9aa5
1 changed files with 2 additions and 1 deletions
|
|
@ -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() )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue