NSTableColumn subclass in an IB palette
NSTableColumn subclass in an IB palette
- Subject: NSTableColumn subclass in an IB palette
- From: Hauke Klein <email@hidden>
- Date: Sun, 10 Oct 2004 14:46:29 +0200
I have a custom NSTableColumn subclass and I'm trying to include this
class
in an Interface Builder palette. The idea is to drag an image from the
palette to
some table view and drop the image on a column of this view. Then, this
column
will be replaced by an instance of my subclass.
Using the BusyPalette example code, I got this almost working. As in
the BusyPalette
code, the actual work is done in the method
-depositViewResourceFromPasteboard:
onObject:atPoint:, and I'm using the NSTableView methods to replace the
original
column with an instance of my NSTableColumn subclass.
Unfortunately, the IB does not really like this new table view. In the
inspector window,
the changed column is still an ordinary NSTableColumn. I saved the nib
file in text
format and checked what IB is thinking. In the nib file, the table view
has it's original
two NSTableColumn columns, but the nib also contains the added custom
column
object. This object believes to be a column of the table view, but the
table view does
not know about this wannabe column.
When opening this weird nib in IB, the program complains about an
inconsistency
in the nib file and removes the additional column. I can edit the nib
file with a text
editor and change one of the columns to my subclass column. Then, IB
removes
the corresponding NSTableColumn and I have a table view with one column
belonging to my subclass. Hence, it is possible to have table views
with columns
of classes distinct from NSTableColumn.
It seems, the palette is required to manage the column objects in some
way,
probably using the methods in the IBDocuments protocol defined in
IBDocuments.h?
Is there any documentation about the IB internals required to write
such a palette,
or at least some description of the various methods in IB framework?
Sorry for the long post, Hauke.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden