yes i've set a breakpoint and watched.
in fact the values are the same before and after (indicating it was ALREADY set 
up correctly
note the code below is called JUST before the call to popup the menu

i only put that extra AE_OS_MAC stuff there to prove again that it is set 
correctly
in reality it is set ahead of time, when the menu is constructed
but either way, it fails until i switch out then back in.

        void    SetMenuCommands(dvaui::utility::OS_Menu *ioMenuP, short 
startIndexS)
        {
                dvaui::utility::OS_Menu::MenuID                 
menuID(GetMenuID(*ioMenuP));
                dvaui::utility::OS_Menu::MenuItemID             
maxS(ioMenuP->Size());
                
                #ifdef AE_OS_MAC
                        dvaui::ui::PlatformMenu         
platMenu(dvaui::utility::GetPlatformMenu(*ioMenuP));
                #endif
                
                for (dvaui::utility::OS_Menu::MenuItemID itemIndexS = 
startIndexS; itemIndexS < maxS; ++itemIndexS) {
                        dvaui::utility::OS_Menu::MenuItemID             itemID 
= ae_menu_utils::CreateMenuCommand(menuID, itemIndexS + 1);

                        ioMenuP->SetItemID(itemIndexS, itemID);

                        #ifdef AE_OS_MAC
                                NSMenuItem*                     
nsMenuItem([platMenu itemAtIndex: itemIndexS]);
                                DVAMacMenuItem*         dvaItem((DVAMacMenuItem 
*)nsMenuItem);

                                [dvaItem 
setAction:@selector(dispatchMenuSelection:)];
                                [dvaItem setTarget: dvaItem];
                                [dvaItem setEnabled: YES];
                        #endif
                        
                        if (startIndexS == 0) {
                                dvaui::utility::OS_MenuSharedPtr                
heirMenu(ioMenuP->GetItemSubMenu(itemIndexS));

                                if (heirMenu.get()) {
                                        SetMenuCommands(heirMenu.get(), 
notifyByPosB);
                                }
                        }
                }
        }


On Feb 19, 2010, at 12:11 PM, Hank Heijink (Mailinglists) wrote:

> On Feb 19, 2010, at 2:43 PM, David M. Cotter wrote:
> 
>> just before the line of code that pops up the menu, i iterate over all the 
>> items
>> so yes, i am absolutely sure it is getting called
>> and i am absolutely sure that myMenuItem is non null
> 
> Posting you code is wildly more helpful than describing it. Also, are you 
> absolutely sure because you've reasoned about your code, or are you 
> absolutely sure because you've set a breakpoint and you've actually *seen* 
> that all is well (i.e. the item exists, the target and action are what you 
> expected)? If you haven't done the latter, you should not be absolutely sure.
> 
> Hank
> 

_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to