FROM : Erik J. Barzeski
DATE : Sat Nov 16 18:23:23 2002
Hi,
On 11/16/02 8:57am, Andrew Merenbach <<email_removed>> 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
<A href="http://weims.net">http://weims.net
<A href="http://barzeski.com">http://barzeski.com
<A href="http://soundsetcentral.com">http://soundsetcentral.com
<A href="http://applescriptcentral.com">http://applescriptcentral.com
###################################################################
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
DATE : Sat Nov 16 18:23:23 2002
Hi,
On 11/16/02 8:57am, Andrew Merenbach <<email_removed>> 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
<A href="http://weims.net">http://weims.net
<A href="http://barzeski.com">http://barzeski.com
<A href="http://soundsetcentral.com">http://soundsetcentral.com
<A href="http://applescriptcentral.com">http://applescriptcentral.com
###################################################################
_______________________________________________
cocoa-dev mailing list | <email_removed>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
| Related mails | Author | Date |
|---|---|---|
| Andrew Merenbach | Nov 16, 07:29 | |
| Erik J. Barzeski | Nov 16, 18:23 |






Cocoa mail archive

