Help with subclassing NSTextField
Help with subclassing NSTextField
- Subject: Help with subclassing NSTextField
- From: Mike Abdullah <email@hidden>
- Date: Sun, 29 Jan 2006 11:46:36 +0000
I need some help with subclassing NSText Field. Basically, what I am
trying to achieve is a control with similar behaviour to
NSDatePicker. I am using it allow the user to set just hours and
minutes (something that NSDatePicker itself doesn't allow). So, my
text field is filled with something like this:
xh : xxm
Where, x is replaced by the values the user is setting.
What I'm having trouble implementing at the moment is the correct
selection behaviour. The idea is that when the user clicks a point
inside the text field, the following should happen:
Look at what part of the field they're clicking on. If it's on of
the 'x's then select all the characters of that number. If it's not
one of the 'x' values, then ignore the mouse and do nothing.
I can easily receive the event that says the user has clicked down on
the overall control. However, how do I detect which character they
are over? Which method should I be overriding exactly? Am I even
setting out correctly by trying to subclass NSTextField? Should I
have gone with NSDatePicker itself?
Please help!
Mike.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden