On 1/24/13 3:50 PM, Nick Rogers wrote:
The code for HoverButton class is almost same as I posted in the first email
with the exception that in the following method I was removing trackingArea
before releasing it.
- (void)updateTrackingAreas
{
if (trackingArea) {
[self removeTrackingArea:trackingArea];// its there in the code that I
have
[trackingArea release];
trackingArea = nil;
}
[self ensureTrackingArea];
[self addTrackingArea:trackingArea];
[super updateTrackingAreas];
}
mouseEntered: and mouseExited: and other methods do not touch the trackingArea
at all.
This puzzled me and so I asked whether the tab view showing these button
changing tab item to another and thus making these buttons invisible would have
any repercussions. Or calling [super updateTrackingAreas]; at the beginning or
end of the method updateTrackingAreas would make any difference.
Another was any ill effect of removing and adding tracking area, which I am not
doing now as the button is not resizable.
Maybe the superclass (NSButton) isn't smart enough to understand the someone
else may change the tracking areas and does something nasty with it (like
assuming all tracking areas currently added are owned too). What if you remove
before calling super and add afterwards. That way, the superclass doesn't see
your custom tracking areas in -updateTrackingAreas
Something like this:
- (void)updateTrackingAreas
{
if (trackingArea) {
[self removeTrackingArea:trackingArea];
[trackingArea release];
trackingArea = nil;
}
[super updateTrackingAreas];
[self ensureTrackingArea];
[self addTrackingArea:trackingArea];
}
Regards
Markus
--
__________________________________________
Markus Spoettl
_______________________________________________
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to arch...@mail-archive.com