• 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: Enabling & Disabling Menu Items (Core Data & Bindings)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Enabling & Disabling Menu Items (Core Data & Bindings)


  • Subject: Re: Enabling & Disabling Menu Items (Core Data & Bindings)
  • From: Volker Runkel <email@hidden>
  • Date: Sat, 14 Jan 2006 10:32:51 +0100

Hi,

in a Document-based app I am writing my Document implements the following method:

- (BOOL)validateMenuItem:(NSMenuItem *)anItem
{

    if ([anItem action] == @selector(copySonagramPlus:))
    {
        return (nil!=BCSupporter);
    }
	if ([anItem action] == @selector(fftSelection:)
		|| [anItem action] == @selector(fftAll:)
		|| [anItem action] == @selector(cutFromMeasurements:)
		|| [anItem action] == @selector(imposeCalls:))
    {
        return ([[callDataController content] count] > 0);
    }
	else if ([anItem action] == @selector(fftFreeSelection:))
    {
		unsigned int start, size;
		[mySoundView getSelection:&start size:&size];
        return (size > 1024);
    }

    // if it isn't one of our menu items, we'll let the
    // superclass take care of it
    return [super validateMenuItem:anItem];
}


and disables / enables Menu items .... just a pointer :-)

Volker


Am 14.01.2006 um 02:07 schrieb Thaddeus Cooper:

Hi All --

I am working on a Core Data project. I have a menu attached to a table that pops up when the user ctrl-clicks the table. One of the entries in the table is "Edit". I would like Edit to only be enabled when a single item is selected in the underlying array controller using bindings. I've looked in the docs and tried a couple of things in a test program and can't seem to get it quite right. I can get it to work with @count, but as I said I need to be more specific.

If anyone has any ideas or a pointer, I would be greatly appreciative.

Thanks very much.

--Thaddeus O. Cooper
(email@hidden)
_______________________________________________
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

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Enabling & Disabling Menu Items (Core Data & Bindings) (From: Thaddeus Cooper <email@hidden>)

  • Prev by Date: Re: Endian-ness of four-char constants (Was: Endian-ness of "PkgInfo" file)
  • Next by Date: Re: Notifications when iPods are mounted...
  • Previous by thread: Enabling & Disabling Menu Items (Core Data & Bindings)
  • Next by thread: Another newbie EXC_BAD_ACCESS in C
  • Index(es):
    • Date
    • Thread