• 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: NSView and NSMenuItem not updating displays
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSView and NSMenuItem not updating displays


  • Subject: Re: NSView and NSMenuItem not updating displays
  • From: Matt Wilks <email@hidden>
  • Date: Fri, 4 Feb 2005 16:15:31 -0500
  • Mail-followup-to: Matt Neuburg <email@hidden>, email@hidden
  • Organization: Computing and Networking Services

On Fri, Feb 04, 2005 at 08:25:07AM -0800, Matt Neuburg wrote:
> 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 define them in the AppController.h file:

	IBOutlet ConnectStatus *status;

and then intialize them in the 'init' function of AppController.m as
above.  I didn't think that I had to initialize them at first, but when
I include the the initialization the NSLog statments I have in the
ConnectStatus NSView are at least outputting.  If I don't initialize
them in 'init', I get no feedback from ConnectStatus.

> >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.

Yes, I am pretty sure that my drawRect is correct since it draws what I
want the first time round.  The problem comes when I try to make updates
to the NSView.

--
Matthew Wilks
University of Toronto        Computing and Networking Services
(416) 978-3328               email@hidden
4 Bancroft Ave., Rm. 102     Toronto, ON  M5S 1C1
 _______________________________________________
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: 
 >Re: NSView and NSMenuItem not updating displays (From: Matt Neuburg <email@hidden>)

  • Prev by Date: Re: Problems Hiding/Showing NSMovieView
  • Next by Date: Re: help:socket programming!
  • Previous by thread: Re: NSView and NSMenuItem not updating displays
  • Next by thread: Re: NSView and NSMenuItem not updating displays
  • Index(es):
    • Date
    • Thread