• 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: How to validate NSComboBoxCell selection
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to validate NSComboBoxCell selection


  • Subject: Re: How to validate NSComboBoxCell selection
  • From: "Robbie Haertel" <email@hidden>
  • Date: Tue, 21 Sep 2004 16:19:28 -0600

I don't have the address of the person who started this post, but I too have been contemplating how to do this. The (untested) idea that I had was to take advantage of the "-(void)tableView:(NSTableView *)aTableView willDisplayCell:(id)aCell forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex" delegate method. The idea is that you can edit the attributes of aCell (i.e. set its datasource or get it and edit it). You could also store a pointer to it so that when editing is done, you can figure out what selection was made. The default implementation of NSTableView (in conjunction with NSTableColumn) stores an instance of an NSCell and then makes a copy of it for each cell it must display. After making the copy, it then calls the delegate willDisplayCell method so that you can edit it. If this is not flexible enough, you could always subclass NSTableColumn and store an array of cells since it has a method to get the cell for any given row.

I'd be interested in knowing if this works in practice (seems like a rather preferable way of doing things that should theoretically work).

Hope this helps!

Robbie

Message: 11
Date: Tue, 21 Sep 2004 15:17:33 +0200
From: Steven Kramer <email@hidden>
Subject: Re: How to validate NSComboBoxCell selection
To: "Prem Anand Joseph" <email@hidden>
Cc: email@hidden
Message-ID: <email@hidden>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed


That's a funny coincidence, I have just been working on a similar problem (except I use a fixed list, not a datasource).

My solution is to do customization of the popup in
tableViewSelectionIsChanging / tableViewSelectionDidChange. Perhaps
this will work for you too...

   Steven

Op 19-sep-04 om 17:01 heeft Prem Anand Joseph het volgende geschreven:

Friends,
 I have an NSTableView column with NSComboBoxCell
 data cell.
 Combobox uses datasource for getting popup list
items.
 I need to filter popup-list entries based upon
some criteria.


_________________________________________________________________
¿Cuánto vale tu auto? Tips para mantener tu carro. ¡De todo en MSN Latino Autos! http://latino.msn.com/autos/


_______________________________________________
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


  • Follow-Ups:
    • Re: How to validate NSComboBoxCell selection
      • From: Steven Kramer <email@hidden>
  • Prev by Date: Re: Deployment Application will not start (solved)
  • Next by Date: Re: Select a NSBezierPath
  • Previous by thread: Re: How to validate NSComboBoxCell selection
  • Next by thread: Re: How to validate NSComboBoxCell selection
  • Index(es):
    • Date
    • Thread