Re: How To: Date/Time Field/Steppers
Re: How To: Date/Time Field/Steppers
- Subject: Re: How To: Date/Time Field/Steppers
- From: Esteban Uribe <email@hidden>
- Date: Mon, 17 Mar 2003 00:09:44 -0800
Hi, Phil
On Sunday, March 16, 2003, at 09:05 PM, Philip Weaver wrote:
I'm kinda stuck trying to implement an Apple-like date/time
field/stepper.
<snip somethings i dont need to know :) >
Does any sample code exist anywhere? I looked through Apple sample
code.
I'm assuming one like the one in the System Preferences -> Date & Time.
The basic idea as I remember reading it off somewhere is that you have
an NSTextField for the background, and then create three borderless
NSTextFields for hour, minute, and second, plus the NSStepper
Make your Controller a delegate of all three. Then respond to the
appropriate delegate method (controlTextDidBeginEditing) and select all
the text in the selected NSTextField (use selectText:). Make a note of
which NSTextField is selected. Then write code to modify the selected
NSTextField, when the NSStepper is used.
This is probably the easiest way to go about doing this.
Have fun,
-Esteban
_______________________________________________
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.