• 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: NSToolbarItem validation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSToolbarItem validation


  • Subject: Re: NSToolbarItem validation
  • From: Chris Miner <email@hidden>
  • Date: Tue, 14 Mar 2006 18:55:10 +0100


Am 14.03.2006 um 18:17 schrieb Tommy Nordgren:


On 14 mar 2006, at 17.56, Chris Miner wrote:


Am 14.03.2006 um 17:10 schrieb Tommy Nordgren:


From the NSView Docs (a base class of NSButton)
Whenever the data or state used for drawing a view object changes, the view should be sent a setNeedsDisplay:

I see. So are you suggesting I tell the NSToolbarItem item's view that it should be re displayed at the end of my validation method? Something like:


if ([[self view] isKindOfClass:[NSControl class]])
{
  NSControl *control = [self view];
  [self setEnabled:[control isEnabled]];
  [[control superview] setNeedsDisplay:YES];
	use [control setNeedsDisplay:YES]
(a control IS a NSView subclass)


I am sorry, I must not have been clear in my original post. The problem isn't with my control's display being updated properly. It's display updated. Through a binding. The problem is that the text of the NSToolbarItem remains grayed out, even though the control is enabled, and even though I am enabling the NSToolbarItem in the validate method.

In any case "[control setNeedsDisplay:YES]" doesn't work and "[[control superview] setNeedsDisplay:YES]". You see, my control is updating, the NSToolbarItem is not. So when I updated the superview of my control, the NSToolbarItem label redrawn as though the item were now enabled. I'm not sure I should have to be doing that, but thanks for the workaround!

_______________________________________________
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


References: 
 >NSToolbarItem validation (From: email@hidden)
 >Re: NSToolbarItem validation (From: Tommy Nordgren <email@hidden>)
 >Re: NSToolbarItem validation (From: Chris Miner <email@hidden>)
 >Re: NSToolbarItem validation (From: Tommy Nordgren <email@hidden>)

  • Prev by Date: Re: Help in grouping set of objects
  • Next by Date: Getting a bullet into a NSString
  • Previous by thread: Re: NSToolbarItem validation
  • Next by thread: Controlling zoom level of an NSRulerView?
  • Index(es):
    • Date
    • Thread