Hi,

I have a Carbon app that I am moving to Cocoa. In an attempt to do that, I
wrote code similar to this in the main function:

[NSApplication sharedApplication];

…

…

[NSApp run];

All the event handling in currently Carbon based. I was expecting problems
but after the changes, the app launched fine. There were a few small issues
related to app quit, but those were easy to fix. I was able to create a new
document and save it too.

*The Problem:*

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 understand that we should move our menu handling to Cocoa and
that would resolve the problem. We will do that, however, we plan to
modernize our app incrementally, taking one step at a time. Is there a low
cost tweak/hack that we can put in for now to make the menus work so that we
can revamp the menu handling a little later?

-          Has anybody else faced similar problems? Were you able to solve
it?


Any help would be appreciated.



Thanks in advance,

Vikram Sethi
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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 arch...@mail-archive.com

Reply via email to