Re: validateMenuItem() not always being called

2008-05-19 Thread jeffs87
So does your custom view implement the action method(s) for the item(s) on the Edit menu which you are trying to validate (e.g., -cut:, -:copy, etc)? If not, your custom view's validateMenuItem method won't be called for those items. That was it:) thanks Jeff __

Re: validateMenuItem() not always being called

2008-05-19 Thread Michael Babin
On May 19, 2008, at 7:08 PM, [EMAIL PROTECTED] wrote: Any object's validateMenuItem method is only called for menu items that would message that object if they were invoked. That means: * Menu items whose target directly points to that object * Menu items whose target is "first responder", a

Re: validateMenuItem() not always being called

2008-05-19 Thread jeffs87
Hi Any object's validateMenuItem method is only called for menu items that would message that object if they were invoked. That means:  * Menu items whose target directly points to that object  * Menu items whose target is "first responder", and your object is on the responder chain and impl

Re: validateMenuItem() not always being called

2008-05-18 Thread Jens Alfke
On 18 May '08, at 8:05 PM, [EMAIL PROTECTED] wrote: I wasn't, but when I did, it still was only called for the File menu. Any object's validateMenuItem method is only called for menu items that would message that object if they were invoked. That means: * Menu items whose target directly

Re: validateMenuItem() not always being called

2008-05-18 Thread Kyle Sluder
On Sun, May 18, 2008 at 11:05 PM, <[EMAIL PROTECTED]> wrote: > The example "SimpleToolbar" has a validateMenuItem method in MyDocument.m > and it too only gets > called for the File menu but the Edit menu is properly updated for Cut, Copy > and Paste. > I guess NSTextView handles it. Correct. NS

Re: validateMenuItem() not always being called

2008-05-18 Thread jeffs87
Hi else { enable = [super validateMenuItem:menuItem]; } I wasn't, but when I did, it still was only called for the File menu. -validateMenuItem: is deprecated; you should probably be using -validateUserInterfaceItem: Tried validateUserInterfaceItem, no change. I recommend Hi

Re: validateMenuItem() not always being called

2008-05-18 Thread Hal Mueller
Correction: deprecated on NSDocument. http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSDocument_Class/Reference/Reference.html#/ /apple_ref/doc/uid/2008-BBCDBJEF Hal On May 18, 2008, at 3:55 PM, j o a r wrote: On May 18, 2008, at 3:46 PM, Hal Mueller wr

Re: validateMenuItem() not always being called

2008-05-18 Thread j o a r
On May 18, 2008, at 3:46 PM, Hal Mueller wrote: -validateMenuItem: is deprecated Really? Where is this documented? j o a r ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the li

Re: validateMenuItem() not always being called

2008-05-18 Thread Kyle Sluder
On Sun, May 18, 2008 at 6:46 PM, Hal Mueller <[EMAIL PROTECTED]> wrote: > -validateMenuItem: is deprecated; you should probably be using > -validateUserInterfaceItem: Not entirely true... according to the Application Menu and Pop-up List Programming Topics for Cocoa document, under "Choosing valid

Re: validateMenuItem() not always being called

2008-05-18 Thread Joel Norvell
Jeff, You need to call super for the "else" cases. Are you doing that? Joel - (BOOL) validateMenuItem: (NSMenuItem *) menuItem { BOOL enable = NO; if ([menuItem action] == @selector(yourSelector:)) { if (yourEnablingLogicForThisSelectorIsSatisfied) { enable

Re: validateMenuItem() not always being called

2008-05-18 Thread Hal Mueller
-validateMenuItem: is deprecated; you should probably be using - validateUserInterfaceItem: (these are both methods, not functions as you wrote). Where to implement it depends on what functionality you're trying to control/limit. If I'm only allowing one document open for read/write at a t

Re: validateMenuItem() not always being called

2008-05-18 Thread Kyle Sluder
On Sun, May 18, 2008 at 4:31 PM, <[EMAIL PROTECTED]> wrote: > I'm new to Cocoa and I created a Document-based Application with New > Project. I added a validateMenuItem() method to my document class and it is Methods in Objective-C are not denoted as you have done. The correct method is -valida

validateMenuItem() not always being called

2008-05-18 Thread jeffs87
Hi, I'm new to Cocoa and I created a Document-based Application with New Project. I added a validateMenuItem() method to my document class and it is only being called when you click on the FIle menu, not any of the other menus. Is the document the correct place for this or do I need o add a