discuss-gnustep
[Top][All Lists]
Advanced

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

Re: FOSDEM Aftermath - the Hotel / Notes from preparing and giving my ta


From: David Chisnall
Subject: Re: FOSDEM Aftermath - the Hotel / Notes from preparing and giving my talk
Date: Sat, 21 Feb 2009 12:46:11 +0000

On 21 Feb 2009, at 10:30, Truls Becken wrote:

Well, then the application would have to set up the menu for each
context. This is already possible, but not used extensively in the
NeXT tradition. Try right-clicking a file in GWorkspace for instance.
The application menu is shown where no context menu is set.

I've not tried this on GNUstep, but on OS X the menu is displayed automatically on right click if the view's menu attribute is defined (either in IB or be calling -setMenu: ) or the view responds to +defaultMenu.

You can make any view that doesn't define it's own custom context menu display the main menu as its context menu by adding this category:

@implementation NSView (ContextMainMenu)
+ (NSMenu*) defaultMenu
{
        return [NSApp mainMenu];
}
@end

This looks slightly weird on OS X because the app name in the menu is filled in automatically in the menu bar, but not as a context menu.

I was under the impression that this is the default behavior in GNUstep, but maybe I'm wrong. I'll need to fire up the NeXTStation to check[1], but I think it worked like this on NeXTSTEP 3.3.

David

[1] If anyone's interested in comparing behavior, I can get the NeXTstation out of the history of computing collection's archive for the Étoilé hackathon.



reply via email to

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