Re: NSMatrix with NSTextFieldCells
Re: NSMatrix with NSTextFieldCells
- Subject: Re: NSMatrix with NSTextFieldCells
- From: Fritz Anderson <email@hidden>
- Date: Wed, 24 May 2006 14:09:15 -0500
On 23 May 2006, at 5:04 PM, Philip Taff wrote:
I have an NSMatrix full of NSTextFieldCells. I have them set to be
noneditable and nonselectable (they should be updated by my code,
not directly by the user), but I want them to be visually
selecatable by single-clicking. I've found that by sending
[theMatrix highlightCell:YES atRow:1 column:1];
I can get the desired visual effect. The problem is finding how to
send it. I tried subclassing NSMatrix to add the highlight code to
mouseUp:, and configured the matrix in IB to use my custom matrix,
but the mouseUp: code was never called. I also tried subclassing
NSTextFieldCell to implement mouseUp:, without much hope since it's
not an NSResponder subclass, and that didn't work either.
Does anyone know how I can get my code called when the mouse button
is released over one of the text cells in my matrix?
Have you considered replacing your text fields with button cells?
That seems to be the behavior you're looking for. You can use -
[NSCell setTitle:] to set the strings appearing in each cell.
-- F
--
Fritz Anderson -- http://www.manoverboard.org/
Consulting Programmer -- http://resume.manoverboard.org/
Step into Xcode, Engrossing Beach Reading! -- http://
six.manoverboard.org/
_______________________________________________
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