• 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
detecting a control's value changing, bindings, null placeholder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

detecting a control's value changing, bindings, null placeholder


  • Subject: detecting a control's value changing, bindings, null placeholder
  • From: "Sean McBride" <email@hidden>
  • Date: Sun, 3 Oct 2004 15:55:47 -0400

Hi,

What method can my custom control override to know that its value is to
change?

I am creating an NSTextField subclass and it does its own cursor rect
handling. Every time the control's value changes I need to recompute the
cursor rect (based on string width). I do this in by overriding
setObjectValue to call super then fix the cursor rects.

This works well, except when I use bindings and the null placeholder.

Say the control is given the value "Hello", its cursor rect is then
calculated correctly, but then the user does something, and my control is
then supposed to show a NULL value, but setObjectValue is never called in
this case, the NullPlaceholder thing seems to do something magic instead. :)

How can my control deal with this?

Thanks!



_______________________________________________
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: Stumped with Binding a User Default NSDictionary
  • Next by Date: Re: displaying window on activation
  • Previous by thread: Re: Stumped with Binding a User Default NSDictionary
  • Next by thread: iPod Detection and Development.
  • Index(es):
    • Date
    • Thread