• 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: Help on Cocoa Class references
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help on Cocoa Class references


  • Subject: Re: Help on Cocoa Class references
  • From: Uli Kusterer <email@hidden>
  • Date: Tue, 18 Jan 2011 17:06:43 +0100

On Jan 18, 2011, at 4:27 PM, Leanne Attard wrote:
> I am developing a java application displaying a window, and then i am taking its native part to draw onto it using openGL, the native part gives me a NSView pointer.  I am able to draw onto it however not able to get mouse/key events appropriately. I am using a category for NSView to override acceptFirstResponder method and other mouse events related methods.

 I think that's the wrong way to go about it. If I undertand things right, what you should really be doing is create a new NSOpenGLView subclass, instantiate that, and than make that a subview of your "native part" using -addSubview:. In that class you can then simply override the proper methods, just like with any other NSView, without weird surprises.

 Using categories to override methods is generally not a good practice, as the behaviour is in many cases quite indeterministic.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."



_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

References: 
 >Re: Help on Cocoa Class references (From: Leanne Attard <email@hidden>)

  • Prev by Date: Re: Help on Cocoa Class references
  • Next by Date: Re: Help on Cocoa Class references
  • Previous by thread: Re: Help on Cocoa Class references
  • Next by thread: RE: Help on Cocoa Class references
  • Index(es):
    • Date
    • Thread