• 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: Binding NSTableColumn.textColor to Two Things;
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Binding NSTableColumn.textColor to Two Things;


  • Subject: Re: Binding NSTableColumn.textColor to Two Things;
  • From: mmalcolm crawford <email@hidden>
  • Date: Fri, 30 Jul 2004 15:19:25 -0700

On Jul 30, 2004, at 2:44 PM, Matt Budd (Madentec) wrote:

The problem is that a change on the preference panel only ripples through to the column of the table view when I change the value in the table view (and it then tries to reapply the transformer which gives the correct dynamic NSColor). I would like a change to ripple through to the text color immediately upon change in the preference panel.

Either register for preferences change notifications, or (probably better), observe user defaults:


- (void)awakeFromNib
{
[[NSUserDefaultsController sharedUserDefaultsController] addObserver:self
forKeyPath:@"values.favoriteColor" // whatever key
options:0
context:favColorContext];
}

- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
{
if (context == favColorContext)
{
[tableview reloadData];
}
// If appropriate: [super observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context];
}


I should probably update the Preferences example to follow this pattern...

mmalc
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


  • Follow-Ups:
    • Re: Binding NSTableColumn.textColor to Two Things;
      • From: Matt Budd (Madentec) <email@hidden>
References: 
 >Binding NSTableColumn.textColor to Two Things; (From: Matt Budd (Madentec) <email@hidden>)

  • Prev by Date: Re: Tiger, File Searching and MetaData
  • Next by Date: Re: Cocoa/Obj-C Restart Computer
  • Previous by thread: Binding NSTableColumn.textColor to Two Things;
  • Next by thread: Re: Binding NSTableColumn.textColor to Two Things;
  • Index(es):
    • Date
    • Thread