• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Carbon menus in Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Carbon menus in Cocoa app


  • Subject: Carbon menus in Cocoa app
  • From: Vikram Sethi <email@hidden>
  • Date: Mon, 30 Nov 2009 18:33:00 +0530

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 (email@hidden)

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:

This email sent to email@hidden

  • Prev by Date: Re: totally baffled by "odoc" apple event failing on launch
  • Next by Date: What to subclass in NSArrayController to enable immediate editing of added rows?
  • Previous by thread: Re: NSAffineTransform scaleBy not scaling
  • Next by thread: What to subclass in NSArrayController to enable immediate editing of added rows?
  • Index(es):
    • Date
    • Thread