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.

Cheers,
Andreas

<NSApplication+Hackery.patch>
Index: NSApplication+Hackery.m
===================================================================
--- NSApplication+Hackery.m	(Revision 2656)
+++ NSApplication+Hackery.m	(Arbeitskopie)
@@ -69,7 +69,37 @@
   DESTROY(old_app_icon);
 }
 
+/*
+   Overrides to show transient version of main menu as in NeXTstep.
+*/
+- (void) rightMouseDown: (NSEvent*)theEvent
+{
+  // On right mouse down display the main menu transient
+  if (_main_menu != nil)
+    {
+      if ([[_main_menu menuRepresentation] isHorizontal])
+        {
+	  // If the menu is horizontal we create a temporary vertical
+	  // version of it and display that instead.
+	  NSMenu *m = [_main_menu copy];
+	  [[m menuRepresentation] setHorizontal: NO];
+          [NSMenu popUpContextMenu: m
+	          withEvent: theEvent
+	          forView: nil];
+	  RELEASE(m);
+        }
+      else
+        {
+          [NSMenu popUpContextMenu: _main_menu
+	          withEvent: theEvent
+	          forView: nil];
+        }
+    }
+  else
+    [super rightMouseDown: theEvent];
+}
 
+
 - (void) setMainMenu: (NSMenu*)aMenu
 {
   if (_main_menu != nil && _main_menu != aMenu)
_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à