[futurebasic] MenuItems on Nib-based menu

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : August 2007 : Group Archive : Group : All Groups

From: Brian Stevens <bstevens33@...>
Date: Fri, 24 Aug 2007 18:00:54 -0700
Most of my current conversion of programmatic menus to Nib-based  
(MenuBar) is going smoothly except for one area:

There is a "Recent Items" hierarchical menu where I need a suggestion  
about processing.  Keep in mind this CE, so I"m intercepting in an  
application handler. The recent items menu is typical behavior as  
found in most apps. The last two items are a menu separator and a  
"Clear Menu" for the last item.  Obviously, the menu item content for  
the recent items varies from no items to several items.

First challenge:  How to intercept one of the recent items when  
picked by the user.

Since those items don't exist when the menu is defined in Interface  
Builder, there is no command to intercept for the menu item. Maybe I  
could add a command to the hierarchical menu (the one the user picks  
that then shows the list of recent items) and then use the menuRef  
from command.menu.menuRef to get the submenu  
(GetMenuItemHierarchicalMenu)? That almost works except  
GetMenuItemHierarchicalMenu wants a menu index (maybe just give it 1  
since the recent items is always going to have 2 items). Still  
looking for a method here.

Second challenge: When items are added (or removed) from the recent  
items menu presumably I can just use standard Menu manager calls  
(Deletemenu etc.)  to adjust the content of the recent items menu ?

Suggestions and code welcome.

TIA-----

Brian S.