gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: validateUserInterfaceItem (NSDocumentController implementation)


From: Fred Kiefer
Subject: Re: validateUserInterfaceItem (NSDocumentController implementation)
Date: Fri, 06 Jun 2008 10:20:09 +0200
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

This method should get called from the user interface to determine whether an item is to be enabled or disabled. This currently doesn't happen in GNUstep (as far as I know). What should happen inside this method is that the object checks whether the action of the item is currently applicable or not. The object should only check its own action methods, not that of other classes. When ever we implement this mechanism, the method on NSDocument will get called for these items where the document itself is the target of the item.

What the document controller could do is to check if saveAllDocuments:, newDocument: and openDocument: are currently possible. I think only the first one make any sense here.

What I cannot remember at the moment is where the calling should happen and whether it would be worthwhile to implement that.

Hope this helps,
Fred

DELHAISE Thierry wrote:
Hi the list,

I'm developping a Desktop GUI app based on NSDocumentController/NSDocument implementation.

The current implementation of NSDocumentController (in gnustep-gui(trunk) revision 26587 ) is :

- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)anItem
{
 // FIXME
 return YES;
}

Should the implementation could be :

call NSDocument "validateUserInterfaceItem", and return the return value.

Second , how [[NSDocumentController instance] validateUserInterfaceItem:sender] get called ?

Thanks in advance for suggestions.


Thierry

PS : I quickly checked Apple doc's : no precision. And I don't have any OSX machines to check.






reply via email to

[Prev in Thread] Current Thread [Next in Thread]