Need recommendations for best way to build a custom view
Need recommendations for best way to build a custom view
- Subject: Need recommendations for best way to build a custom view
- From: Ken Tozier <email@hidden>
- Date: Thu, 19 Feb 2009 16:17:06 -0500
Hi
I'm trying to display documents in a specific way but am having a very
hard time trying to figure out how to do it with any of Apple's built-
in gui widgets. I've tried probably a half dozen different approaches
over the last several months, but there doesn't seem to be any Apple
widgets that fit the bill and my efforts writing custom NSCells and
views have become hopelessly complex. Basically all I want to do is
present the following information in a list
add button project name
delete button page number master page popup menu
delete button page number master page popup menu
delete button page number master page popup menu
delete button page number master page popup menu
add button project name
delete button page number master page popup menu
delete button page number master page popup menu
add button project name
delete button page number master page popup menu
etc...
Seems simple enough but I can't use tables because columns are a
single width and project names are much longer than page numbers. What
I end up with are ridiculously long page number fields to display
short numbers like 1, 2, 3, etc. I had a small bit of success, at
least with respect to the way items were layed out, using custom
NSCells, but this quickly gets mired in dozens of overrides and hit
testing parts of the cell to make the subcells work.
I tried writing my own table class from scratch that allows for not
just cells but entire views to act in the role of cells in traditional
NSTables. This worked to an extent, but one requirement, that projects
can each have a different number of pages, made vertical refreshing
really squirrely when pages are added or deleted to a project. It took
me over a month to write the class and still it didn't work like I
wanted. In desperation, I tried using a web view and writing the code
in Javascript which proved much much simpler to get the layout
correct, but it was really slow as the number of rows started getting
large.
This seems like it should be easy, but getting this view working has
been, by far, the most difficult part of my entire application.
Interfacing with databases was a snap by comparison, writing entire
file management utilities, a breeze, writing other custom views to
search for and display complex production data, a piece of cake. But
displaying a simple list where projects can have arbitrary number of
pages and grow or shrink as pages are added or deleted has proven to
be an absolute nightmare.
What is the best way to do this? I took a look at Leopard's
NSCollectionView class but even this seems to fall short as you have
to explicitly define the depth of the subviews and my subviews must
vary in depth.
Any help appreciated.
_______________________________________________
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