• 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: capturing button-clicks on an Image
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: capturing button-clicks on an Image
  • Next by Date: Re: IB is confused (or I am :-)
  • Previous by thread: capturing button-clicks on an Image
  • Next by thread: Shared Memory and Distributed Objects
  • Index(es):
    • Date
    • Thread