Re: Button cell palette
Re: Button cell palette
- Subject: Re: Button cell palette
- From: "Erik J. Barzeski" <email@hidden>
- Date: Sat, 16 Nov 2002 12:23:23 -0500
Hi,
On 11/16/02 8:57am, Andrew Merenbach <email@hidden> wrote:
>
I have about a dozen NSButtonCell subclasses, each of which draws a
>
button in a different color (for a periodic table of the elements,
>
which lays out the table in an NSMatrix). Instead of using all those
>
classes, which are cumbersome, I'd like to create an IB palette that
>
will allow me to create a "PTMatrix" which will can and will be filled
>
with only a single NSButtonCell subclass. One other thing makes this a
>
bit more complicated: this subclass must have a custom inspector in the
>
info window, so I can set the color of each cell individually in IB.
>
>
I've had limited success with the IB palette examples and the tutorial
>
from Aaron Hillegass' book, and any pointers would be appreciated.
>
(For example, will I need to create not one, but *two* IB palettes, one
>
for the matrix and one for its cells?)
Funny, I have a periodic table with a bunch of colored buttons on it, and I
only had to use one subclass... I don't know if your approach is correct if
you have a dozen. All you need is one instance variable: NSColor
*myCoolColor; Then use that when you do your cell's drawing... A dozen?
Seems fruity.
One single "color button" cell would make a lovely Interface Builder
palette.
You'll only need one palette: for the cell. Option-drag will create
duplicates. You'll probably then programmatically set their colors... I
think. I didn't use a matrix myself because I didn't want them to have to
"line up"
References:
http://www.barzeski.com/ichem/
http://www.cocoadevcentral.com/tutorials/showpage.php?show=00000043.php
--
Kindest regards,
Erik J. Barzeski
As an adolescent I aspired to lasting fame, I craved factual
certainty, and I thirsted for a meaningful vision of human life -
so I became a scientist. This is like becoming an archbishop so you
can meet girls. -- Matt Cartmill, anthropology professor and author
###################################################################
Email: erik@(anything below) AIM: iacas
http://iacas.org http://weims.net
http://techstra.net http://barzeski.com
http://cocoadevcentral.com http://soundsetcentral.com
http://freshlysqueezedsoftware.com http://applescriptcentral.com
###################################################################
_______________________________________________
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.