Re: capturing button-clicks on an Image
Re: capturing button-clicks on an Image
- Subject: Re: capturing button-clicks on an Image
- From: "William H. Schultz" <email@hidden>
- Date: Sat, 15 Feb 2003 23:28:45 -0500
hello,
I am thinking of writing a card game and so I'd be using Images all
over the
place. I was thinking of using NSImage for that.
Obviously I'd need to implement a delegate used by the NSImage to
handle
buttonclicks and drags. My question is where/how can I determine the
methods my
delegate needs to implement.
Also can anyone point me to a good reference/discussion about
delegates and
their uses?
thanks
Zameer
Zameer,
Actually, looking into NSView would probably be much more productive.
You would use an NSImage to draw in the view; however, the NSView
itself would much more easily tell you where the user clicked. It
would also determine very easily for you which card was clicked.
Look into subclassing an NSView. Also, look into creating an NSView
hierarchy. If you set each card to be a different view, the existing
NSView superclass will determine where clicks were made and where the
user is dragging. This should be a relatively trivial thing to set up.
Hank
_______________________________________________
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.