Le 30 nov. 07 à 11:39, Andreas Schik a écrit : > Hi there, > I have become a real fan of the horizontal main menus and of > EtoileMenuServer. However, what bothered me was that on right- > clicking the application only real context menus are poppimg up, but > no longer the main menu, which is feature I also used a lot. > Thus, i have hacked NSApplication+Hackery to enable this. In my hack > i create a temporary vertical copy of the horizontal main menu to > pop up beneath the mouse pointer. For those who are interested in > this (and I believe some of you are) I attach the patch for this. > The patch is against the latest SVN.
Hi Andreas, Thanks a lot for your patch. I have an updated version of it that I will commit tomorrow. Instead of overriding -mouseDown: in NSApplication, I have choosen to override +defaultMenu in NSResponder and NSView. I think it fits better with AppKit API and allows to display this menu in any views even if a superview redefines - rightMouseDown:. In this case, with your patch the superview would intercept -rightMouseDown: in the responder chain and NSApplication would never get it. If a view defines a contextual menu, this vertical main menu won't be shown. I may add a preference in future allowing to disable this feature, but for now it's turned on by default. Initially my plan was to let the user free to decide whether he prefers to use normal contextual menus or this vertical main menu as contextual menu. But AppKit allows to override all menus related methods, so you cannot ensure the developer won't break the default behavior. We could tell the developer he must call a superclass method, but AppKit documentation needs to be updated then. The best way would be to add an AppKit private method that is called everytime a contextual menu is going to be displayed, but this involves overriding many more methods (which I prefer to avoid) or making a feature request to GNUstep. So it will remain in the current state unless someone is really interested to work out a solution. Cheers, Quentin. _______________________________________________ Etoile-discuss mailing list [email protected] https://mail.gna.org/listinfo/etoile-discuss
