Re: NSView and NSMenuItem not updating displays
Re: NSView and NSMenuItem not updating displays
- Subject: Re: NSView and NSMenuItem not updating displays
- From: Matt Neuburg <email@hidden>
- Date: Fri, 04 Feb 2005 08:25:07 -0800
On Thu, 3 Feb 2005 15:57:09 -0500, Matt Wilks <email@hidden>
said:
>I've got a custom NSView and a couple of NSMenuItems (in the main menu)
>declared like so:
>
> IBOutlet ConnectStatus *status = [[ConnectStatus alloc] init];
> IBOutlet NSMenuItem *connectItem = [[NSMenuItem alloc] init];
> IBOutlet NSMenuItem *disconnectItem = [[NSMenuItem alloc] init];
If you are creating these objects yourself, then in what sense are these
IBOutlets?
>I am having trouble getting them to update their displays during
>execution of the program. The MenuItems are being enabled and disabled
>like:
>
> [connectItem setEnabled:YES];
> [disconnectItem setEnabled:NO];
>
>And the custom NSView something like:
>
> [status setColor:[NSColor redColor]];
> [status setString:@"DISCONNECTED"];
What makes an NSView display is what its drawRect says. The way a menu item
is enabled depends on your response to validateMenuItem:. m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide
<http://www.amazon.com/exec/obidos/ASIN/0596005571/somethingsbymatt>
_______________________________________________
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