View Hierarchies for apps like Quartz Composer
View Hierarchies for apps like Quartz Composer
- Subject: View Hierarchies for apps like Quartz Composer
- From: Darren Minifie <email@hidden>
- Date: Wed, 7 Oct 2009 17:03:59 -0700
Hi Everyone
I've recently tried implementing a tool that functioned similar to Quartz
Composer (the tool was for an entirely different purpose, and I did not know
about Quartz Composer at the time). Basically, the user is presented with a
canvas. On the canvas, the user can place squares that represent components,
and these components can be linked together by dragging a line from one to
another. While, I did get an implementation working, I felt it was quite a
bit of hackery, and I'm wondering if anybody else has any experience with
such a user interface? For me, the hard part was figuring out which view
hierarchy the connecting lines belonged to. For example my view hierarchy
was NSWindow --> Canvas --> Components. A connecting line from one
component to another didn't seem to fit as a subview of any one component,
because its bounds were not within that of any single component - they were
between components. My solution was to create a clear CALayer for each
line, and that layer was owned by the canvas, not any component. Whenever a
component was moved on the screen, the appropriate lines needed to be
updated as well. My solution seemed, to me, to have far to many layers and
weak references.
There are many applications like this: OmniGraffle, Keynote (to some
extent), OpenOffice, Reason, etc. Is this type of interface so common that
there are known "tricks" to solving the problem easier (I'm thinking
something analogous to a design pattern). Thanks a lot.
--
Darren Minifie
Computer Science Masters Candidate
University of Victoria, BC. Canada
My Rants: www.noisyair.com
My Band: www.ohsnapmusic.com
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden