Re: Was: Re: NSStepper - useless?
Re: Was: Re: NSStepper - useless?
- Subject: Re: Was: Re: NSStepper - useless?
- From: Seth Willits <email@hidden>
- Date: Sun, 26 Feb 2012 17:09:11 -0800
On Feb 26, 2012, at 4:44 PM, William Squires wrote:
>>> Why didn't they just make the NSStepper a custom view that draws two arrows, and has two sent actions that you can connect? Or even a variation of NSMatrix with two button cells that look like arrows. That would avoid the problem entirely, and be more intuitive to use.
>>
>> Not really. The control's intended use is to increment and decrement a value. That's what it does. If you're not using the stepper for manipulating a numeric value, you should probably be using a different control.
>
> I'm just saying the stepper itself should not have a value, it should send actions to a controller so it can manipulate a numeric value in a model object, or it should be able (using bindings) to increment/decrement a model's value. Using the UI as a model isn't what MVC is all about.
The stepper having a value doesn't break MVC any more than a text field having a string value, or a slider having a numeric value, does. And bindings require that the stepper have a value to begin with.
All basic controls are architected the same way — they all maintain a value which they display and manipulate. When that value changes, they send an action. A stepper doesn't display it's value, but there's little or no benefit to architecting it totally differently. That would just be pushing more responsibility onto the controller which isn't necessary when the stepper can do it correctly for everyone to begin with.
Whatever scenario you've cooked up where you need to know whether the value is being incremented or decremented (which you can still easily do) is not the norm.
--
Seth Willits
_______________________________________________
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