• 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
Help with subclassing NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Prev by Date: Re: Using Evan Schoemberg's Custom tabs
  • Next by Date: Re: Moderator: EOT (Re: Apple Finder team is hiring)
  • Previous by thread: Re: Enabling Standard AppleScript Support with Cocoa App
  • Next by thread: -[NSAttributedString initWithPasteboard:...] vs. Dictionary
  • Index(es):
    • Date
    • Thread