]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/carbon/toolbar.cpp
copying native cursor under cocoa
[wxWidgets.git] / src / osx / carbon / toolbar.cpp
index ca9c011d89bbedebe443bc724aaeb0c88c742ea0..35b9bd4ff87ceb0c643c62b58fed0bcfbc71e864 100644 (file)
@@ -927,6 +927,11 @@ bool wxToolBar::Create(
 wxToolBar::~wxToolBar()
 {
 #if wxOSX_USE_NATIVE_TOOLBAR
+    // We could be not using a native tool bar at all, this happens when we're
+    // created with something other than the frame as parent for example.
+    if ( !m_macToolbar )
+        return;
+
     CFIndex count = CFGetRetainCount( m_macToolbar ) ;
     // Leopard seems to have one refcount more, so we cannot check reliably at the moment
     if ( UMAGetSystemVersion() < 0x1050 )
@@ -1317,6 +1322,10 @@ bool wxToolBar::Realize()
                             wxFAIL_MSG("Reference count of native tool was illegal before removal");
                         }
                         wxASSERT( IsValidControlHandle(tool->GetControl()->GetPeer()->GetControlRef() )) ;
+
+                        wxString label = tool->GetLabel();
+                        if ( !label.empty() )
+                            HIToolbarItemSetLabel( hiItemRef, wxCFStringRef(label, GetFont().GetEncoding()) );
                     }
                 }