• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSForm from NSFormCell
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSForm from NSFormCell


  • Subject: Re: NSForm from NSFormCell
  • From: Negm-Awad Amin <email@hidden>
  • Date: Fri, 8 Aug 2008 20:51:10 +0200


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 (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

Amin Negm-Awad email@hidden




_______________________________________________

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


  • Follow-Ups:
    • Re: NSForm from NSFormCell
      • From: "Ken Ferry" <email@hidden>
References: 
 >NSForm from NSFormCell (From: Kurt Sutter <email@hidden>)

  • Prev by Date: How to obtain NSApplication from kCGWindowOwnerPID?
  • Next by Date: Re: CGImageSourceCreateFromURL failed with error -11
  • Previous by thread: NSForm from NSFormCell
  • Next by thread: Re: NSForm from NSFormCell
  • Index(es):
    • Date
    • Thread