Am Fr,08.08.2008 um 20:22 schrieb Kurt Sutter:

I have a series of NSFormCell objects in an NSForm.

Given the NSFormCell object, is there a way to get the corresponding NSForm object?

More specifically: I have added an class extension to NSFormCell, which does some operations on the form cell. One of the operations requires the method to select the form cell, and the method would therefore like to call selectTextAtIndex of the owning NSForm. However, all I have is "self" of the NSFormCell, and I have no clue how to obtain the NSForm object therefrom.

Any advice?
1. Probably you have to change a part of your design. Cells are like stamps or templates for drawing and user events. "Belonging" is a term, which is a littlebit strange for a cell. This is the reason for passing the concrete view as a argument to several messages, i. e. - drawWithFrame:inView:. Of course, any cell belongs to a view (control) in reality, but not by structure.

2. However you can add a property to the cell (you have a subclass) and set it in a subclass of NSFormCell or from outside. As said, this is not the intended structure.

3. I've seen – do not ask me where, pls – that some people remember the view through the last -drawWithFrame:inView: message. IMHO this is worse.

Amin


Kurt

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/negm-awad%40cocoading.de

This email sent to [EMAIL PROTECTED]

Amin Negm-Awad
[EMAIL PROTECTED]




_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to