Re: Disabling menu items

2017-10-06 Thread Shane Stanley
On 7 Oct 2017, at 10:41 am, Kevin Perry wrote: > > This should be handled automatically by NSDocumentController’s implementation > of -validateUserInterfaceItem: / -validateMenuItem:. Any chance you’re > overriding either of those methods and returning YES for menu items you

Re: Disabling menu items

2017-10-06 Thread Kevin Perry
This should be handled automatically by NSDocumentController’s implementation of -validateUserInterfaceItem: / -validateMenuItem:. Any chance you’re overriding either of those methods and returning YES for menu items you don’t own (instead of calling super)? > On Oct 6, 2017, at 4:13 PM, Shane

Disabling menu items

2017-10-06 Thread Shane Stanley
I fear I'm missing something simple. When I enter the versions browser, I want to disable the items on the Open Recent submenu. But I'm not seeing anywhere obvious to do it; that menu looks like it's all handled opaquely. Any clues? -- Shane Stanley ,

Re: Disabling menu items

2009-05-16 Thread Uli Kusterer
On 15.05.2009, at 19:05, Quincey Morris wrote: A better approach would be for your NSDocument subclass instances to check, in initWithType: or one of the ReadFrom... methods, if a document already exists (via [NSDocumentController documents]), and simply return an error if so. [Actually,

Disabling menu items

2009-05-15 Thread McLaughlin, Michael P.
In a Cocoa Document project (latest Xcode), I want to have only one document open at a time. I thought that I could do this by subclassing NSDocumentController but I have been only partially successful. For instance, just as a test, the subclass code contains

Re: Disabling menu items

2009-05-15 Thread Mike Abdullah
If you have no idea what the First Responder is, you are clearly out of your depth. Step back and read up on the Responder Chain. It is a very important concept and central to Cocoa. Mike Abdullah. On 15 May 2009, at 16:01, McLaughlin, Michael P. wrote: In a Cocoa Document project (latest

Re: Disabling menu items

2009-05-15 Thread McLaughlin, Michael P.
On 5/15/09 11:52 AM, Mike Abdullah cocoa...@mikeabdullah.net wrote: If you have no idea what the First Responder is, you are clearly out of your depth. Step back and read up on the Responder Chain. It is a very important concept and central to Cocoa. Mike Abdullah. I know what a First

Re: Disabling menu items

2009-05-15 Thread Quincey Morris
to do all of this. Could someone point me to a code example somewhere? Or a good description? If you mean exactly what you say, then I'd suggest that trying to enforce your restriction by disabling menu items is doomed to failure. There are plenty of ways that a NSDocumentController

Re: Disabling menu items

2009-05-15 Thread Jerry Krinock
On May 15, 2009, at 08:01, McLaughlin, Michael P. wrote: There must be an easy way to do all of this. Mike's advice is correct. Understanding how to get menu items enabled/ disabled often requires more than the back of an envelope. Could someone point me to a code example somewhere? Or