• 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: menu enabling/disabling in Java
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: menu enabling/disabling in Java


  • Subject: Re: menu enabling/disabling in Java
  • From: Henri Lamiraux <email@hidden>
  • Date: Mon, 23 Jul 2001 13:53:28 -0700

You should not be comparing the menu title in the first place
(localization!!!). You need to compare the action associated with a menu
item.

SEL action = [menuItem action];
if (action == @selector(addFile:))
return YES;
else
return NO;

On Monday, July 23, 2001, at 11:40 AM, Brian Webster wrote:

> The reason that this isn't working is because you are comparing two
> string objects to see if they're the same _object_, instead of
> comparing to see if they hold the same string contents. You should use
> menuItem.title().equals("Add File") instead.


References: 
 >Re: menu enabling/disabling in Java (From: Brian Webster <email@hidden>)

  • Prev by Date: Re: Use of NSLog() for debugging
  • Next by Date: re: A question about static typing
  • Previous by thread: Re: menu enabling/disabling in Java
  • Next by thread: initWithFocusedViewRect problem
  • Index(es):
    • Date
    • Thread