Question about NSMatrix (was Re: Setting a class' action)
Question about NSMatrix (was Re: Setting a class' action)
- Subject: Question about NSMatrix (was Re: Setting a class' action)
- From: Andrew Merenbach <email@hidden>
- Date: Thu, 15 Aug 2002 16:07:14 -0700
Thanks to all who responded to my earlier post about assigning a single
action to many buttons. It looks like the NSMatrix class is indeed what
I'm looking for, but I have another question. I've created a giant
matrix, and many of the buttons are transparent, and it works. In
creating my various subclasses of NSButtonCell to color the buttons, I
had to override drawInteriorWithFrame: with the following, for example:
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView
*)controlView
{
[[NSColor colorWithDeviceRed:1 green:0 blue:0 alpha:.25] set];
[NSBezierPath fillRect: cellFrame];
}
...which creates a red button. Unfortunately, in overriding
drawInteriorWithFrame:, the buttons' titles, which I assigned in
Interface Builder, do not show up. Is there a simple way to ask the
system to draw the titles of the buttons, from within
drawInteriorWithFrame, or should I override a different method?
Take care,
Andrew Merenbach
_______________________________________________
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.