Open michaelbach opened 1 year ago
Milestone: Someday. Label: #new. What's next? A reviewer should examine this issue.
+#ready-to-commit +Bindings +AppKit
Milestone: Someday. Labels: #new, #ready-to-commit, AppKit, bindings. What's next? The changes for this issue are ready to be committed by a member of the core team.
i tend not to merge this one. closestTickMarkValueToIndex is not part of cocoa. what is a good use case for this? at least, the method should be underscored to mark it as a private addition. -#ready-to-commit
I'll take a look at this too. We do want to precisely match AppKit APIs (for documentation and reference testing) unless a very good reason exists.
Dear Daniel:
i tend not to merge this one. closestTickMarkValueToIndex is not part of cocoa. what is a good use case for this? at least, the method should be underscored to mark it as a private addition. -#ready-to-commit
Please do merge. Use case: without it, one cannot make slider values stop at tick marks and communicate via bindings. I use it very often. Example: https://michaelbach.de/ot/mot-rmi/
closestTickMarkValueToIndex
was already called in the code, but was massing, so I added it.
Very happy with underscore.
Thanks, Michael -- https://michaelbach.de
I'll look at this next week too. If it introduces a non-cocoa API, I would like to consider carefully. Agree entirely with your rationale, @michaelbach. I also want to introduce more automated and manual tests - we've let this slide a bit over the last two or three years. Restricting ourselves to cocoa-only APIs opens opportunities to automate testing against a native app (not necessarily for this PR, but more complex ones).
Milestone: Someday. Labels: #new, AppKit, bindings. What's next? A reviewer should examine this issue.
closestTickMarkValueToIndex
was already called in the code, but was massing, so I added it. Very happy with underscore.
i cannot find any call to closestTickMarkValueToIndex in the current implementation. where did you see this?
if this is only used by your code, it may be better to add this to your your codebase by means of a category of CPSlider.
Fix: slider knob did not follow “setObjectValue” when set to “Only stop at tick marks”. Needed a new method closestTickMarkValueToIndex, called in knobRectForBounds. [Tick marks still are not drawn, but binding to value works now.]