Re: Changing the shape of NSButton
Re: Changing the shape of NSButton
- Subject: Re: Changing the shape of NSButton
- From: Shawn Erickson <email@hidden>
- Date: Mon, 29 Jul 2002 18:11:59 -0700
On Monday, July 29, 2002, at 05:51 PM, Kevin C Stevens wrote:
I am working on my first Cocoa application, specifically a user
interface.
To minimize mouse movement while maximizing clickable area, I am basing
part of the interface on hex maps (familiar to all of us who played
D&D).
Poking around the API, it seems that I need to do one of two things,
neither of which do I have the knowledge to pull off: (the third thing,
the good idea I missed, will hopefully be supplied by someone else)
1. Overload the draw methods for NSButton in a subclass in order to
create
a hexagon. Sounds good, but the only draw methods I saw were strictly
related to rectangles. Can I do this?
You can draw all kind of arbitrary paths using NSBezierPath. However I
believe cells always have rectangular frames and as a result would need
to overlap.
It may be simpler and better performing to draw your hex tile pattern
in a custom view and track mouse movements and clicks as needed.
Assuming I can do either of these two things, can I put the new button
object on a palette in IB?
Yes.
I suggest getting a hold of a Cocoa book to pick this stuff up the
fastest.
Several exist look here -
http://makeashorterlink.com/?L2D323261
I personally liked Hillegass's book -
http://makeashorterlink.com/?B2C312261.
-Shawn
_______________________________________________
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.