Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > How to make a set-time widget (like Date & Time prefpane)?

How to make a set-time widget (like Date & Time prefpane)?
Thread Tools
galarneau
Senior User
Join Date: Sep 2002
Location: Canastota, New York
Status: Offline
Reply With Quote
Mar 2, 2003, 12:36 PM
 
I have an app that needs to have the user set a time. Right now, I'm just using a simple NSTextField and the user has to be careful to enter the time as the proper format (hh:mm:ss).

What I'd like to have is a control like in the Date & Time pref panel, where the user can't click on the colons and can tab between the hour/min/sec bits of the field, as well as be able to increment/decrement via the NSStepper controls.

I'm guessing I'll have to subclass an exisiting control and take it from there? Problem is... I don't know how to subclass controls and modify them yet.

If someone cold offer some advice on where to start or at least a hint as to the proper way to do this, it would be a big help. Learning how to do it will be a good exercise for me, but I just need to be pointed in the right direction.

Thanks much

P.S. It would be nice if there was a repository for 3rd party custom widgets. I was just reading a thread about implementing a custom slider in the VLC program. The next programmer who wants to implement a widget like this will have to do it all over again. Seems a shame for us to keep reinventing the wheel.
( Last edited by galarneau; Mar 2, 2003 at 12:45 PM. )
     
galarneau  (op)
Senior User
Join Date: Sep 2002
Location: Canastota, New York
Status: Offline
Reply With Quote
Mar 7, 2003, 06:31 AM
 
Looks like someone has made it:

http://s.sudre.free.fr/Software/DevPotPourri.html

Man, the help on this forum is underwhelming
     
int69h
Dedicated MacNNer
Join Date: Nov 2000
Status: Offline
Reply With Quote
Mar 7, 2003, 09:01 AM
 
Originally posted by galarneau:

Man, the help on this forum is underwhelming
Remember that you get what you pay for.
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:42 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,