• 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: Hover button and tracking area questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Hover button and tracking area questions


  • Subject: Re: Hover button and tracking area questions
  • From: Nick Rogers <email@hidden>
  • Date: Thu, 24 Jan 2013 20:20:05 +0530

Hi,

Thanks for the reply.

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.

Thanks,
Nick

On 24-Jan-2013, at 7:24 PM, Markus Spoettl <email@hidden> wrote:

> On 1/24/13 12:06 PM, Nick Rogers wrote:
>> The code that I pasted was going thru change. In the original copy, I was
>> removing tracking area before adding the new.
>>
>> So now my thinking goes that I shouldn't have added tracking areas after the
>> initial one, at least I am now doing that and hoping it not to crash.
>
> I'm doing this (dynamically removing and adding tracking areas) all the time, and while it does have drawbacks that Kyle explained, it works just fine. If your memory management is OK, this will work. The fact that you're crashing indicates that you're over-releasing your tracking area (or something else is). Post your real code, we may spot something.
>
> Regards
> Markus
> --
> __________________________________________
> Markus Spoettl
> _______________________________________________
>
> 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

_______________________________________________

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

  • Follow-Ups:
    • Re: Hover button and tracking area questions
      • From: Markus Spoettl <email@hidden>
References: 
 >Hover button and tracking area questions (From: Nick Rogers <email@hidden>)
 >Re: Hover button and tracking area questions (From: Kyle Sluder <email@hidden>)
 >Re: Hover button and tracking area questions (From: Quincey Morris <email@hidden>)
 >Re: Hover button and tracking area questions (From: Kyle Sluder <email@hidden>)
 >Re: Hover button and tracking area questions (From: Kyle Sluder <email@hidden>)
 >Re: Hover button and tracking area questions (From: Nick Rogers <email@hidden>)
 >Re: Hover button and tracking area questions (From: Markus Spoettl <email@hidden>)

  • Prev by Date: Re: NSAttributedString boundingRectWithSize vs. paragraph margins
  • Next by Date: Re: Multithreading crash in -[NSConditionLock unlockWithCondition:]
  • Previous by thread: Re: Hover button and tracking area questions
  • Next by thread: Re: Hover button and tracking area questions
  • Index(es):
    • Date
    • Thread