• 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: NSMatrix Question...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMatrix Question...


  • Subject: Re: NSMatrix Question...
  • From: Jerry LeVan <email@hidden>
  • Date: Wed, 30 Jun 2004 18:25:02 -0400

Hmmm, since a select cell is unique this is a wee bit shorter...

-(void)drawInteriorWithFrame:(NSRect)frame inView:(NSView *)controlView
{
if ( [(NSMatrix*)controlView selectedCell] == self)
{
[[NSColor selectedControlColor] set];
NSRectFill (frame);
}

[super drawInteriorWithFrame:frame inView:controlView];
}

I think it says, *always* draw the selected cell with a blue background :)

Jerry

On Jun 30, 2004, at 5:57 PM, Stephen Norum wrote:

Check out my application, MPC Pad 187. You can download it here:

http://ieee.usask.ca/members/snorum/

The matrix of buttons on the left works the way you want I think. Let me know if this is/isn't what you want.


Stephen



On Jun 30, 2004, at 3:54 PM, Jerry LeVan wrote:

What I should have written is how can I keep the cell
highlighted *after* it has been clicked.

The current highlighting is when the mouse goes up, the
cell is highlighted and then dehighlighted, just like a
regular button.
I need to keep the highlighting.


Jerry
On Jun 30, 2004, at 5:46 PM, Stephen Norum wrote:

Sorry, I misread your question the first time. Here's what I should have written:

On Jun 29, 2004, at 9:34 PM, Jerry LeVan wrote:

I have an NSMatrix of subclassed NSImageCells. The matrix is
setup in radiobutton mode so my action will be called when
a cell is clicked.

Is there any way I can keep the selected cell highlighted when
clicking on the rascal?

You could change your NSImageCells to NSButtonCells, then by setting up the NSMatrix as an NSRadioModeMatrix, it should handle the highlighting for you.

In the awakeFromNib, all I do is:

[theNSMatrix setMode:NSRadioModeMatrix];

It might be less work.

Stephen Norum
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Prev by Date: Re: NSMatrix Question...Answered
  • Next by Date: iTunes-like player buttons
  • Previous by thread: Re: NSMatrix Question...
  • Next by thread: ANN: Excelsior! Path Preview 0.1
  • Index(es):
    • Date
    • Thread