• 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: Re: NSSlider unusual behavior
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Re: NSSlider unusual behavior


  • Subject: Re: Re: NSSlider unusual behavior
  • From: "Michael Ash" <email@hidden>
  • Date: Mon, 4 Sep 2006 13:30:17 -0400

On 9/4/06, Ivan Kourtev <email@hidden> wrote:
I couldn't find anything in the docs that explains this behavior.

I understand that setContinuous makes the slider send its action
continuously.  The question is why it continues to send the action
message when the mouse is down, the slider has been dragged all the
way to an end, and the mouse is doing whatever (while still down) out
of the NSSlider rectangle?  Why send the action message repeatedly
(under the above conditions) if the slider position and value have
not changed (it's stuck at an end), hence, the action message is not
delivering to the target any new information?

Why not do it?

It's simpler to write code that simply sends the action when the mouse
is moved, regardless of whether this results in a change in value.

I am curious because I am doing stuff in response to the slider's
position and I thought receiving the action message is a 100%-sure
indication the position has changed.  Well, it seems at the ends of
the sliders this is not true.  I can, of course, modify the code so
that it detects the slider position hasn't change.  But that does not
seem elegant and logical at all (unless I am missing some conceptual
reasons for this behavior).

You are relying on behavior which is not documented. This means that your code is broken. You are fortunate that it's broken right now, as opposed to working perfectly now and, say, breaking because Apple changed the behavior in Leopard.

Code to the docs, not to your guesses, and stuff works better.

Mike
_______________________________________________
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


References: 
 >NSSlider unusual behavior (From: Ivan Kourtev <email@hidden>)
 >Re: NSSlider unusual behavior (From: Ryan Stevens <email@hidden>)
 >Re: NSSlider unusual behavior (From: Ivan Kourtev <email@hidden>)

  • Prev by Date: NSFormatter and text color
  • Next by Date: Multiple drags joined in one undo group
  • Previous by thread: Re: NSSlider unusual behavior
  • Next by thread: Re: NSSlider unusual behavior
  • Index(es):
    • Date
    • Thread