• 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
Button state behavior broken by overriding drawInteriorWithFrame
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Button state behavior broken by overriding drawInteriorWithFrame


  • Subject: Button state behavior broken by overriding drawInteriorWithFrame
  • From: Darrin Filer <email@hidden>
  • Date: Mon, 11 Feb 2002 17:39:27 -0500

I recently subclassed NSCell and overroad drawInteriorWithFrame
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView

Strange thing is, this broke the button. It now behaves more like a Push On / Push Off button! The state isn't On until after releasing and it remains on until clicking and releasing the button again. Simply commenting out my version of drawInteriorWithFrame fixes the problem. I'm only drawing into the controlView so what gives?

I tried to work around this by overriding the following 3 NSCell methods:
- startTrackingAt:inView:
- continueTracking:at:inView:
- stopTracking:at:inView:mouseIsUp:

Unfortunately, the second two of these are never called even though the docs say that
- trackMouse:inRect:ofView:untilMouseUp:
should call the continueTracking and stopTracking methods.


Another quick question related to working around this problem:
When a momentary push in button is initially clicked, does its state change immediately or only after it is determined if the subsuquent mouseUp is located within the button? In other words, in my drawInteriorWithFrame routine, do I only need to look at the button's state or do I also need to know if the button is in the midst of being pressed? I'm hoping that the former is true so that after the problem detailed above is fixed, I won't need to add any custom tracking in order to properly draw the button.

darrin filer
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Is this a bug in NSTextView or a feature? (From: Stéphane Sudre <email@hidden>)

  • Prev by Date: Re: about help
  • Next by Date: Re: newbie question on 'Cocoa Programming for Mac OS X'
  • Previous by thread: Re: Is this a bug in NSTextView or a feature?
  • Next by thread: Re: Is this a bug in NSTextView or a feature?
  • Index(es):
    • Date
    • Thread