Re: cocoa-dev digest, Vol 2 #3298 - 15 msgs
Re: cocoa-dev digest, Vol 2 #3298 - 15 msgs
- Subject: Re: cocoa-dev digest, Vol 2 #3298 - 15 msgs
- From: Ron Ballesteros <email@hidden>
- Date: Wed, 3 Dec 2003 13:05:40 -0800
On Dec 2, 2003, at 11:03 AM, email@hidden wrote:
Message: 11
Cc: email@hidden
From: Shawn Erickson <email@hidden>
Subject: Re: NSStepper in Energy Saver in System Preferences?
Date: Tue, 2 Dec 2003 09:56:33 -0800
To: Ron Ballesteros <email@hidden>
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.
You are completely correct. I opened up the nib file for the Energy
Saver and
there are three subclasses of a NSTextField and each having pointing to
the same delegate which is a subclass of NSControl.
I'm just unsure what delegate methods to implement for the NSTextField
so that when the user clicks in a particular NSTextField, I can
properly change the value of the corresponding value and update the
correct NSTextfield?
Thanks...
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.