Colorful buttons of different shapes

2010-04-13 Thread Abhijeet Singh
Hi,I am porting my Win32 application to Mac. I am new to Cocoa. In my Windows 
Win32 application I have a window in that there is a 3 X 8 matrix of 24 
buttons. Buttons are labeled as 124. Each button has 3 states. Unused Round 
shape green color(Default state) SelectedSquare shape orange color (User 
selects a button)UsedRound Shape red color (User save the selection by clicking 
Save button)In Win32 application I use owner drawn buttons to draw button of 
different color and shape.I'd be glad if someone could suggest me which control 
should i use in Cocoa to achieve the same effect.Should I use NSMatrix of 
buttons? If yes than how can i set color and shape of buttons?Thanks  
RegardsAbhijeetDear cocoadev ! Get Yourself a cool, short @in.com Email ID now!
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Colorful buttons of different shapes

2010-04-13 Thread Graham Cox

On 13/04/2010, at 9:58 PM, Abhijeet Singh wrote:

 effect.Should I use NSMatrix of buttons?

It would be a straightforward solution.

 If yes than how can i set color and shape of buttons?


You'd probably need a NSButtonCell subclass. Drawing alternative appearances is 
pretty easy that only needs one or two overrides.

--Graham


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com