Lisp HUG Maillist Archive

Menus on Mac OS X

On Mac OS X, when running a CAPI app with menus inside the LW IDE,  
the menus appear in the LW Application menu between Preferences...  
and Services. When running the delivered app, the menus look fine. I  
haven't found information regarding this in the documentation, so:
1. Is this the normal behaviour?

When closing the app which is run inside the LW IDE, the apps menus  
are left in the LW Application menu. After running the app a couple  
of times, this results in multiple sets of menus between  
Preferences... and Services in the LW Application menu.
2. Is it possible to get rid of these menus when closing the app, or  
should I not bother since it is not the same in the delievered app?

I have a dynamic menu, where I compute the menu-items using  
the :items-function. This function seems to be triggered every time I  
press anywhere in the menubar, not only on the menu with the :items- 
function. This happens during development in the LW IDE and also in  
the delivered app. I expected the items-function to trigger when  
choosing the menu, right before the menu-items are shown, but this is  
not the case.
3. Why does it trigger when clicking anywhere in the menubar and not  
only when clicking the specific menu?

Thanks in advance!
/Sven 


Re: Menus on Mac OS X

Hi Sven,


>1. Is this the normal behaviour?


I experimented exactly the same situation as you. To avoid this
multiplication of menus in the LW menu in development phase, I finished by
keep my application menu only for the delivered context.
And I thing this is the normal behavior because this menu is linked with an
instance (the cocoa-default-application-interface) witch is normally not
present in the development environment.

If you need to try your menu, why not experiment it as a normal menu ? Your
codes can make the distinction between the two contexts, development and
application, and adapt the menubar in consequence.

Le 26/01/09 14:16, « [NOM] » <[ADRESSE]> a écrit :

> 3. Why does it trigger when clicking anywhere in the menubar and not
> only when clicking the specific menu?

I don't know, but it's the case for all the functions called on items, for
instance the :selected-function and :enabled-function.

Naturally, this doesn't seem the most efficient way to work, especially if
you have a lot menu-items in your menubar. But I think that this behavior is
linked to the COCOA management of menus. Because (if I well remember what I
read some times ago) in Cocoa the menubar is simply a menu instance
containing the other menus, exactly as menus contains submenus.

Best regards

Denis

-------------------------------------------------------
Denis Pousseur
70 rue de Wansijn
1180 Bruxelles, Belgique

Tel : 32 (0)2 219 31 09
Mail :  denis.pousseur@gmail.com
-------------------------------------------------------



Updated at: 2020-12-10 08:41 UTC