• 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
Re: Carbon menus in Cocoa app
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Carbon menus in Cocoa app


  • Subject: Re: Carbon menus in Cocoa app
  • From: Vikram Sethi <email@hidden>
  • Date: Mon, 7 Dec 2009 10:20:35 +0530

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@hidden> 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
>
>


--
Ξ √ίkř@m Ŝεth! Ξ
_______________________________________________

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

References: 
 >Re: Carbon menus in Cocoa app (From: Eric Schlegel <email@hidden>)

  • Prev by Date: Re: Draw rounded NSImage
  • Next by Date: Re: NSTableView reloadData works just on init.
  • Previous by thread: Re: Carbon menus in Cocoa app
  • Next by thread: Re: totally baffled by "odoc" apple event failing on launch
  • Index(es):
    • Date
    • Thread