• 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: Button cell palette
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: progress bar question
  • Next by Date: Opening multiple times the same window ?
  • Previous by thread: Button cell palette
  • Next by thread: wakeup signals in OS X
  • Index(es):
    • Date
    • Thread