Programming Mac's Dock like with Cocoa

Discussion in 'Mac Programming' started by satyam90, Apr 21, 2009.

  1. satyam90 macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #1
    Hi, I am using Cocoa framework with Obj C.
    For my application, I want to have Mac's Dock like bar with some icons in that. Infact a tool bar which is transparent like dock, which has zoom effect similar to dock. Can some body have examples of such programming. Please share with me.
     
  2. three macrumors 6502a

    three

    Joined:
    Jan 22, 2008
    Location:
    Washington State
    #2
    You are coding a application that basically has a dock in it?
     
  3. satyam90 thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #3
    Yes, I want to have dock like control in my application.
     
  4. satyam90 thread starter macrumors regular

    satyam90

    Joined:
    Jul 30, 2007
    Location:
    Bangalore, India
    #4
    Is it possible to make an icon in toolbar big when mouse is placed on it? It might provide zooming effect that is there in dock.
     
  5. kainjow Moderator emeritus

    kainjow

    Joined:
    Jun 15, 2000
    #5
    You're going to need to do this in a custom view and draw the images yourself. I don't think any built-in control would be sufficient, although NSMatrix would work if you didn't handle the zoom effect.
     
  6. lucasgladding macrumors 6502

    Joined:
    Feb 16, 2007
    Location:
    Waterloo, Ontario
    #6
    Seconded. Personally I would use a custom view with NSImageView subviews. Track the mouse movements inside the main view and calculate the mouse X position as a percentage of the width of the view. You could then scale the NSImageViews based on their distance from the current mouse location. If you adjust the frames using a Core Animation animator, that will get you the soft animation you want. I wouldn't adjust the frames with every mouse movement, just after a certain number of pixels or percentage of the view width. That tolerance could also be calculated as the view width divided by the number of NSImageViews.

    Best of luck

    Luke
     

Share This Page