Re: trackingRect can't be removed?
Re: trackingRect can't be removed?
- Subject: Re: trackingRect can't be removed?
- From: "Julien Jalon" <email@hidden>
- Date: Mon, 20 Mar 2006 22:38:15 +0100
Tracking rects are tightly bounded to the window, not to the view.
This means that it makes no sense to add/remove a tracking rect in a
view if the view is not in a window.
Consequence, you should always make sure you start adding tracking
rects after viewDidMoveToWindow NSView's callback with [view window]
!= nil and that you removed all those rects before returning
viewWillMoveToWindow:window with window == nil.
On 3/20/06, Michael Link <email@hidden> wrote:
> I have a button subclass to do rollovers and am experiencing some
> strange behavior with removal of the trackingRect when the view is
> removed from the superview.
>
> When I click the rollover button to have the view removed from the
> superview and discarded it seems that even though the trackingRect is
> removed it isn't. The button gets a MouseEntered event and then I
> click the button and it sends its action to be removed (and it is).
> Next when I move the mouse out of the supposedly deleted trackingRect
> a MouseExited event is generated and sent to the freed object which
> causes a crash.
>
> Anyone else experience something like this?
>
> 2006-03-20 13:12:25.111 MyCrawl[890] -[CRConnectionTableView
> _contentViewBoundsDidChange:]
> 2006-03-20 13:12:41.510 MyCrawl[890] -[MXRolloverButton
> addTrackingRect:owner:userData:assumeInside:] <MXRolloverButton:
> 0x5f9bb90> 13
> 2006-03-20 13:12:41.510 MyCrawl[890] -[MXRolloverButton
> addTrackingRect:owner:userData:assumeInside:] <MXRolloverButton:
> 0x5f9aca0> 14
> 2006-03-20 13:12:41.761 MyCrawl[890] NSEvent: type=MouseEntered loc=
> (312,144) time=10189.6 flags=0 win=0 winNum=1481 ctxt=0xb813
> evNum=314 trackNum=13 userData=0
> 2006-03-20 13:12:44.614 MyCrawl[890] -[CRConnectionTableView
> _connectionWillBeRemoved:]
> 2006-03-20 13:12:44.642 MyCrawl[890] -[MXRolloverButton
> removeFromSuperview] <MXRolloverButton: 0x5f9bb90> 13
> 2006-03-20 13:12:44.660 MyCrawl[890] -[MXRolloverButton
> removeTrackingRect:] <MXRolloverButton: 0x5f9bb90> 13
> 2006-03-20 13:12:44.666 MyCrawl[890] -[MXRolloverButton
> removeFromSuperview] <MXRolloverButton: 0x5f9aca0> 14
> 2006-03-20 13:12:44.667 MyCrawl[890] -[MXRolloverButton
> removeTrackingRect:] <MXRolloverButton: 0x5f9aca0> 14
> 2006-03-20 13:12:44.667 MyCrawl[890] -[MXRolloverButton dealloc]
> <MXRolloverButton: 0x5f9aca0> 0
> 2006-03-20 13:12:44.668 MyCrawl[890] -[MXRolloverButton dealloc]
> <MXRolloverButton: 0x5f9bb90> 0
> 2006-03-20 13:12:44.725 MyCrawl[890] -[MXRolloverButton
> addTrackingRect:owner:userData:assumeInside:] <MXRolloverButton:
> 0x5f15310> 21
> 2006-03-20 13:12:44.732 MyCrawl[890] -[MXRolloverButton
> addTrackingRect:owner:userData:assumeInside:] <MXRolloverButton:
> 0x5ff0ed0> 22
> 2006-03-20 13:13:05.244 MyCrawl[890] NSEvent: type=MouseExited loc=
> (303,143) time=10213.3 flags=0x100 win=0 winNum=1481 ctxt=0xb813
> evNum=315 trackNum=13 userData=0
> 2006-03-20 13:13:05.265 MyCrawl[890] *** -[_NSViewAuxiliary
> mouseExited:]: selector not recognized [self = 0x5f9bb90]
>
> --
> Michael
>
> _______________________________________________
> 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
>
>
>
_______________________________________________
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