How to imitate the workflow view of Automator?

Posted by andyfeind on Stack Overflow See other posts from Stack Overflow or by andyfeind
Published on 2010-04-05T15:32:19Z Indexed on 2010/04/06 14:53 UTC
Read the original article Hit count: 212

Filed under:
|
|

I’m starting to develop my first full-blown Cocoa application containing a view which I would like to behave (and look) similar to Automator’s AMWorkflowView.

The basic features I’d like to achieve:

  • Positioning of subviews
  • Display of subviews in expanded / collapsed states
  • Multiple selection
  • Drag and drop

In order to get accustomed to Cocoa, I started with a custom NSView which mainly served as a container for the custom subviews and handled their positioning and multiple selection. The subviews are also subclasses of NSView, and contain a variable amount of views themselves, like buttons, labels and popup menus, and therefore can have different heights. This worked quite well, but before going on, I want to make sure to have everything neat and tidy according to the MVC pattern.

I suspect that there already is a class in Cocoa that facilitates the implementation of a view container, like maybe NSCollectionView. It seems that there is no (easy) way to display differently sized views in an NSCollectionView, though. Should I continue implementing my custom NSView (probably using an NSArrayController for selection and sorting support), or are there better ways to go?

Any help is much appreciated

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about nsview