I had some offline discussion with Eric around this. The problem was that I had stopped calling RunApplicationEventLoop() function, which installs an event handler that calls MenuSelect() in response to clicks on the menu bar. When I switched to Cocoa, MenuSelect() was not getting called. As a solution, I need to call MenuSelect() explicitly when the menu bar is clicked. This solves the problem.
Thanks for all the help. Regards, Vikram Sethi On Wed, Dec 2, 2009 at 12:08 AM, Eric Schlegel <[email protected]> wrote: > > On Nov 30, 2009, at 5:03 AM, Vikram Sethi wrote: > > > Though the menu bar appears and the individual menu items get created and > > get added to the hierarchy (verified it while debugging), the menus do > not > > open when I click on the menu bar. The menus are also Carbon based. They > are > > defined as a ‘MBAR’ resource and the menu bar gets created using the > > GetNewMBar() API. This API has been marked ‘Not recommended’ though it is > > not deprecated. Documentation says use NIB files instead. > > > > I tried similar changes in another Carbon based app. This app opened fine > > and I was able to access the menus also. Unlike my app, this ref app > defines > > the menus in a NIB file and creates the menu bar using the NIB file. > > I would not actually expect that there would be any difference in the > behavior of the two applications based solely on how the menus are created. > Regardless of whether you create your menus from an 'MBAR' or from a nib, > once the menus are created, they should behave the same at runtime. It > sounds to me that there is some other difference in the event-handling > process of the two applications, which probably could be fixed in your real > application without needing to move to nib files. > > Can you send me copies of both the working and non-working applications and > I'll see what the difference is? > > -eric > > -- Ξ √ί...@m Ŝεth! Ξ _______________________________________________ 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]
