• 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: NSCell subclass editing
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSCell subclass editing


  • Subject: Re: NSCell subclass editing
  • From: Corbin Dunn <email@hidden>
  • Date: Wed, 3 Oct 2007 09:51:35 -0700


Hmm, I'll try to explain what I mean :
Right now, when you're using default (eg NSTextFieldCell) cells, your tableview datasource recieve - tableView:setObjectValue:tableColumn:row when editing finishes, allowing the datasource to update itself (storing the new value in to whatever stuff you're using as datasource ;-)).
Trying to override this behavior in -[NSCell editWithFrame:inView:editor:delegate:event:] right now is a real pain, meaning that if I want my NSCell subclass to use something other than NSText for editing, (eg display an NSOpenPanel, or NSColorPanel) :
- I need to call my super implementation (which has the drawback that the text editor display for a short while before the panel covers it), setting the -[NSText string] to the NSOpenPanel result back in the NSOpenPanel selector called after the sheet is closed (whici is the value passed to the datasource in the end). This also means passing a color is impossible with this approach...
- Use private stuff inside NSTableView to make it call it's delegate with the correct object (which break the separation between a cell and its control, because now my cell will only work inside NSTableViews).


NSCell should be made editor-agnostic, by changing - [editWithFrame:...] into -[editWithFrame:InView:] (putting the current implementation in NSTextFieldCell, where it belongs), and - [endEditing:(NSText*)] into -[endEditing: (id)theObjectThatWillBePassedToTheDelegate], but that's my 2 cents...

You *could* do this in a subclass of NSTableView. Simply make some informal protocol and expect your cells to call it.


Have you logged a bug/feature request for this? Please do, if you want to see things like this end up in AppKit.

corbin
_______________________________________________

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


References: 
 >NSCell subclass editing (From: tiennou <email@hidden>)
 >Re: NSCell subclass editing (From: Boris Remizov <email@hidden>)
 >Re: NSCell subclass editing (From: tiennou <email@hidden>)

  • Prev by Date: Re: Nib & retainCount confusion
  • Next by Date: NSSavePanel's required/allowed types
  • Previous by thread: Re: NSCell subclass editing
  • Next by thread: Re: Where are the boundaries of Cocoa and how are the boundaries perceived ?
  • Index(es):
    • Date
    • Thread