Re: Cannot get mouseMoved in NSView
Re: Cannot get mouseMoved in NSView
- Subject: Re: Cannot get mouseMoved in NSView
- From: Henry McGilton <email@hidden>
- Date: Sun, 28 May 2006 18:45:18 -0700
On May 28, 2006, at 5:18 PM, Lorenzo wrote:
I did it already. I overrided the method acceptsFirstResponder in
my view
- (BOOL)acceptsFirstResponder { return YES; }
I even added a trackingRect in the init method of my view
[self addTrackingRect:[self bounds] owner:self userData:nil
assumeInside:NO];
...but no luck. Other ideas?
I seem to recall that when I tried setting up the tracking rects
in the initWithFrame method of the view, that it did not work.
I conjecture that this is because, at the time the view's
initWithFrame method is called, the view has not yet been
added to its superview, and therefore, the window that will
contain that view can not do anything with the tracking rects.
I ended performing this rough sequence in a controller object:
allocate the view
initalise the view with the initWithFrame method
add the view to its superview
then establish the tracking rects
I had discussed this on the list a couple of times, and nobody
has ever told me I am correct. But then, nobody has ever told
me I was incorrect either, so I have followed that style since.
Cheers,
........ Henry
===============================+============================
Henry McGilton, Boulevardier | Trilithon Software
Objective-C/Java Composer | Seroia Research
-------------------------------+----------------------------
mailto:email@hidden | http://www.trilithon.com
|
===============================+============================
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden