IB and a NSActionCell in a NSTableView
IB and a NSActionCell in a NSTableView
- Subject: IB and a NSActionCell in a NSTableView
- From: Lorenzo <email@hidden>
- Date: Sun, 26 Mar 2006 10:37:03 +0200
Hi,
I have an "Enter Value" group of outlets that I use everywhere in my
interface. This group is composed by the subclassed objects:
1) A custom NSTextView
2) A custom NSButtom I use as slider (with a custom image)
3) A NSStepper
Now I have to put this group of outlets into a cell of my NSTableView, and
of course I don't want to lose the behaviour of each object's subclass.
I checked the Apple sample code "ClockControl".
In order to have such a "model" of my custom cell, in IB, I created a NSView
containing this group of outlets. This will be the look of my cell.
Then, in XCode, I subclassed an NSActionCell and assigned it to the column's
dataCell of my tableView. Later, according to the frames of the outlets in
that "model" NSView, I drew each single outlet's cell within the column
cell's method drawWithFrame:
It worked well. But, of course, those outlets are just images drawn within
the "cell". They are not clickable and, most of all, they have not the
behaviour of my custom class objects.
So I have been working for 2 days with "trackMouse" tracking any outlets
frame, detecting the mouse click and drag, but I cannot yet call the custom
class object's methods when e.g. I drag my slider.
For example my slider responds to the method mouseDragged. But if I call
[mySlider mouseDragged:theEvent];
from within the "trackMouse" method, I get a loop and the application
freezes. How to solve this problem? Any idea?
Why doesn't IB let the developer customizes his tableView row with e.g a
custom NSView containing whathever? Look at FileMaker, you just put fields,
images, check-boxes, lines... into the row body, and you have done!
Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
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