• 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
Re: what is the easy way to update all bound controls
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: what is the easy way to update all bound controls


  • Subject: Re: what is the easy way to update all bound controls
  • From: Vitaly Ovchinnikov <email@hidden>
  • Date: Mon, 25 May 2009 22:58:47 +0400

Just found a solution!
I added action to my NSPopUpButton:
- (IBAction) onUnitsChanged: (id) sender
{
    NSView *v = [[self window] contentView];
    [v setNeedsDisplay:YES];
}

this seems to update all controls and refresh bound values exactly as I need.

Feel free to suggest solutions without this action.

On Mon, May 25, 2009 at 10:09 PM, Vitaly Ovchinnikov
<email@hidden> wrote:
> Hello list,
>
> I have a document that has a dimension parameter (NSSize). I bound
> this size to some text field using formatter. The formatter allows to
> show size both in millimeters and inches. User may switch units by
> NSPopupButton that is bound to shared user defaults controller. My
> formatter reads user defaults each time it formats size to string.
> This works fine, but my text field doesn't update automatically when I
> change measurement units from inches to millimeters and back again.
>
> I can observe user defaults and update each control manually, but I
> have many such controls that bound to many other properties of the
> document. Each control shows measurements and they all should be
> updated according the new measurement unit selected. It is really hard
> to have a list of those controls.
>
> What is the correct way to do this?
>
> Thank you.
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >what is the easy way to update all bound controls (From: Vitaly Ovchinnikov <email@hidden>)

  • Prev by Date: UIButton and UIView touch handling issues
  • Next by Date: Removing delay for a menu in NSSegmentedControl?
  • Previous by thread: what is the easy way to update all bound controls
  • Next by thread: Underlining a Tab item label
  • Index(es):
    • Date
    • Thread