]> git.saurik.com Git - wxWidgets.git/blobdiff - src/cocoa/toolbar.mm
just added a comment
[wxWidgets.git] / src / cocoa / toolbar.mm
index 3688f0e7b370c308b9b26dd7d5d068e05c3bb6c1..bf0d2a4d5a3d370d1e44989b5b5a75c0bf094399 100644 (file)
@@ -221,6 +221,11 @@ bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase)
     return true;
 }
 
+bool wxToolBar::Cocoa_acceptsFirstMouse(bool &acceptsFirstMouse, WX_NSEvent theEvent)
+{
+    acceptsFirstMouse = true; return true;
+}
+
 bool wxToolBar::Cocoa_drawRect(const NSRect &rect)
 {
     wxToolBarToolsList::compatibility_iterator node;
@@ -253,6 +258,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
         NSButtonCell *buttonCell = m_mouseDownTool->GetNSButtonCell();
         if(buttonCell)
         {
+            [buttonCell retain];
             [buttonCell setHighlighted: YES];
             if([buttonCell trackMouse: theEvent
                 inRect:AddToolPadding(m_mouseDownTool->GetFrameRect()) ofView:m_cocoaNSView
@@ -263,6 +269,7 @@ bool wxToolBar::Cocoa_mouseDragged(WX_NSEvent theEvent)
                 wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked after drag!"));
             }
             [buttonCell setHighlighted: NO];
+            [buttonCell release];
         }
     }
     return wxToolBarBase::Cocoa_mouseDragged(theEvent);
@@ -276,6 +283,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
         NSButtonCell *buttonCell = tool->GetNSButtonCell();
         if(buttonCell)
         {
+            [buttonCell retain];
             m_mouseDownTool = tool;
             [buttonCell setHighlighted: YES];
             if([buttonCell trackMouse: theEvent
@@ -287,6 +295,7 @@ bool wxToolBar::Cocoa_mouseDown(WX_NSEvent theEvent)
                 wxLogTrace(wxTRACE_COCOA,wxT("Button was clicked!"));
             }
             [buttonCell setHighlighted: NO];
+            [buttonCell release];
         }
     }
     return wxToolBarBase::Cocoa_mouseDown(theEvent);