• 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: NSStepper in Energy Saver in System Preferences?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSStepper in Energy Saver in System Preferences?


  • Subject: Re: NSStepper in Energy Saver in System Preferences?
  • From: Shawn Erickson <email@hidden>
  • Date: Tue, 2 Dec 2003 09:56:33 -0800

On Dec 2, 2003, at 9:13 AM, Ron Ballesteros wrote:

I wanted to know how does the NSStepper in the Energy Saver in System Preferences (Panther) determine which part of the time value is being incremented or decremented? I wanted to know how by clicking on the hour or minute the NSStepper appropriately knows which instance variable to increment or decrement?

The NSStepper doesn't likely know anything. It is a view component, a control. The controller that the NSStepper sends its actions to likely knows what is being adjusted and updates the model as needed.

It appears to be all in one NSTextField with some kind of formatter I take it?

I believe it is made of a few text fields placed next to each other or a specialized sub-class but to know for sure...

Not quite sure?

You can crack open the nib for it and take a look (see in /System/Library/PreferencePanes).

It looks to be a mix of a few view components all using custom classes. A collection of three NSTextField subclasses, contained in a NSBox, inside of a NSControl subclass.

The NSControl subclass knows about its stepper (likely to set its current value and range as the target changes). The NSStepper sends its action to the NSControl subclass. Also a controller object knows of the stepper and is also a delegate of the NSControl subclass. Note that the 3 NSTextFields also have the NSControl subclass as a delegate. Draw your own conclusions...

-Shawn
_______________________________________________
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: 
 >NSStepper in Energy Saver in System Preferences? (From: Ron Ballesteros <email@hidden>)

  • Prev by Date: Re: rounding a float
  • Next by Date: makeWindowControllers question
  • Previous by thread: NSStepper in Energy Saver in System Preferences?
  • Next by thread: Re: Source code documentation systems for Cocoa (and C)
  • Index(es):
    • Date
    • Thread