Prefs menu in Carbon
-
I have a carbon app with its own Prefs menu under File. But there is an extra Prefs menu added under the application menu when running in OS X. How do I remove the extra Prefs menu? If I can't, then how do I even use it with my app?
-
On Thursday, January 25, 2001, at 05:46 PM, Mike Vannorsdel wrote:> I have a carbon app with its own Prefs menu under File. But there is an extra Prefs menu
> added under the application menu when running in OS X. How do I remove the extra Prefs
> menu? If I can't, then how do I even use it with my app?
Remove the preferences under 'File', they aren't supposed to be there. Use Carbon Events to get the prefs menu item event (there's another function to enable the item, can't remember the name).
andy
--
We fucked up. We fucked up big time.
-- Steve Jobs -
Andreas Monitzer wrote :> On Thursday, January 25, 2001, at 05:46 PM, Mike Vannorsdel wrote:
>
>> I have a carbon app with its own Prefs menu under File. But there is an
>> extra Prefs menu
>> added under the application menu when running in OS X. How do I remove the
>> extra Prefs
>> menu? If I can't, then how do I even use it with my app?
>
> Remove the preferences under 'File', they aren't supposed to be there. Use
> Carbon Events to get the prefs menu item event (there's another function to
> enable the item, can't remember the name).
>
> andy
It's a little more complex than that if your application is supposed to work
on Mac OS 9 and Mac OS X :
- Mac OS 9 : Your PreferencesÅ menu item should be in the Edit Menu
according to the HIG (at the bottom of the Edit menu ?)
- Mac OS X : I believe there is a gestalt to know whether you need to remove
your Preferences Menu Item.
Anyway you can use the code given in the ADC Newsletter :
static Boolean RunningOnCarbonX(void)
{
UInt32 response;
return (Gestalt(gestaltSystemVersion,(SInt32 *) &response) == noErr)
&& (response >= 0x01000);
}
--
Stephane -
On Thursday, January 25, 2001, at 07:51 PM, Stephane Sudre wrote:> It's a little more complex than that if your application is supposed to work
> on Mac OS 9 and Mac OS X :
> - Mac OS 9 : Your Preferences⦠menu item should be in the Edit Menu
> according to the HIG (at the bottom of the Edit menu ?)
> - Mac OS X : I believe there is a gestalt to know whether you need to remove
> your Preferences Menu Item.
>
> Anyway you can use the code given in the ADC Newsletter :
>
> static Boolean RunningOnCarbonX(void)
> {
> UInt32 response;
>
> return (Gestalt(gestaltSystemVersion,(SInt32 *) &response) == noErr)
> && (response >= 0x01000);
> }
That's incorrect. You have to check for gestaltMenuMgrAquaLayoutBit.
andy
--
We fucked up. We fucked up big time.
-- Steve Jobs -
> You have to check for gestaltMenuMgrAquaLayoutBit.
Indeed. If gestaltMenuMgrAquaLayoutBit is set then you should remove
your own Quit and Preferences commands.
You can enable the Preferences command in the application menu with
EnableMenuCommand( NULL, kHICommandPreferences);
kHICommandPreferences hasn't made it into the headers yet, but its
definition is:
const kHICommandPreferences MenuCommand = 'pref';
It's also worth knowing that as well as the Carbon Event, you get an
AppleEvent of class 'aevt' and ID 'pref'.
Richard.
--
Sailmaker Software: Programming and consultancy services.
<http://www.sailmaker.co.uk/>
PGP key: E88BA153 = 140D E231 73C5 CA24 CD48 FE4C BDA9 308C E88B A153 -
Ok, I'll use the OS X Pref menu, thanks. I'm doing this with PowerPlant. Should I use PowerPlant's menu functions or just use straight carbon events? I'm not sure how to reference the application menu, I thought it would be at menu ID 128 but that didn't work.
On Thursday, January 25, 2001, at 10:19 AM, Andreas Monitzer wrote:> Remove the preferences under 'File', they aren't supposed to be there. Use Carbon Events
> to get the prefs menu item event (there's another function to enable the item, can't
> remember the name).
>
> andy


