About Menu Extras in OSX 10.1.
About Menu Extras in OSX 10.1.
- Subject: About Menu Extras in OSX 10.1.
- From: "Tommy Tian" <email@hidden>
- Date: Thu, 24 Apr 2003 15:14:58 +0800
Hi,all
I think the 3 API only can work in 10.2 and later. How can I do it in OSX 10.1? Thanks ;)
Tommy Tian
http://www.webex.com
--------------------------------------------------------------------------
Chris,
though I'm not an assembly language expert at all, I'm quite sure about
the number of arguments for each function:
int CoreMenuExtraAddMenuExtra( CFURLRef path, int position, int whoCares,
int whoCares2, int whoCares3, int whoCares4);
int CoreMenuExtraGetMenuExtra( CFStringRef identifier, void *menuExtra);
int CoreMenuExtraRemoveMenuExtra( void *menuExtra, int whoCares);
Hope this helps.
Frank
--
http://www.vercruesse.de
>
I've written a Menu Extra which is working just fine. I've also
>
implemented a System Preferences prefs pane to control the menu extra.
>
>
I used gdb, nm, and otool to figure out how the Sound panel (and others)
>
were showing, removing, and getting the status of their Menu Extras, and
>
found out a great deal about it, but my poor knowledge of assembly has
>
got me stuck.
>
>
I've included a header file which I hacked up which shows what I've got
>
so far. I would appreciate it if someone could please help me (and
>
eventually others) to get this interface working properly.
>
>
If only there was a class-dump for plain old C code...
>
>
>>> BEGIN QUOTED FILE: CoreMenuExtra.h
>
>
/*
>
* $Id: CoreMenuExtra.h,v 1.1.1.1 2001/10/28 01:55:29 bootc Exp $
>
* SysMenu: CoreMenuExtra.h
>
*
>
* Created by bootc on Sun Oct 28 2001.
>
* Copyright (c) 2001 The Macintosh Developer Center. All rights
>
reserved.
>
*
>
* Reverse-engineered (using gdb, otool, and nm) functions present in
>
* HIServices.framework for dealing with Menu Extras. What a mess...
>
*
>
* I'm no expert in assembly code. In fact, I know almost nothing about
>
it,
>
* so if someone can help me out I'd be very grateful. In effect, I don'
>
t
>
* know exactly how many parameters there are for these functions and
>
exactly
>
* what they do, nor am I sure of the return types.
>
*/
>
>
#include <CoreFoundation/CoreFoundation.h>
>
>
/*
>
* MenuExtraRef
>
*
>
* Discussion:
>
* From what I can figure out, this seems to be an opaque type with no
>
* ties to real memory (as in, an index in a private array/hashtable).
>
*/
>
typedef struct OpaqueMenuExtraRef *MenuExtraRef;
>
>
/*
>
* CoreMenuExtraAddMenuExtra()
>
*
>
* Discussion:
>
* This routine inserts a Menu Extra into the menu bar.
>
*
>
* Parameters:
>
*
>
* inURL:
>
* The URL to the Menu Extra to add.
>
*
>
* inAfterItem:
>
* The index after which item you want it inserted (0: leftmost, 1:
>
next
>
* one along, -1: last one (after clock));
>
*
>
* Result:
>
* If the Menu Extra is already in the menu bar, this returns
>
memFullErr.
>
* I don't know about any other error codes, but I'm sure they exist.
>
*/
>
OSStatus CoreMenuExtraAddMenuExtra(
>
CFURLRef inURL,
>
SInt32 inAfterItem);
>
>
/*
>
* CoreMenuExtraGetMenuExtra()
>
*
>
* Discussion:
>
* Gets a reference to a Menu Extra in the menu bar.
>
*
>
* Parameters:
>
*
>
* inIdentifier:
>
* The bundle identifer of the Menu Extra to fetch.
>
*
>
* outMenuExtra:
>
* A reference to the menu extra. Doesn't seem to have any
>
significant
>
* value. NULL if not present in menu bar.
>
*
>
* Result:
>
* This returns noErr even if the Menu Extra is not present, in which
>
case
>
* outMenuExtra will be NULL.
>
*/
>
OSStatus CoreMenuExtraGetMenuExtra(
>
CFStringRef inIdentifier,
>
MenuExtraRef * outMenuExtra);
>
>
/*
>
* CoreMenuExtraRemoveMenuExtra()
>
*
>
* Discussion:
>
* Removes a Menu Extra from the menu bar.
>
*
>
* Parameters:
>
*
>
* inMenuExtra:
>
* The Menu Extra to remove.
>
*
>
* Result:
>
* The only error code I've seen here is noErr. It crashes if you pass
>
it
>
* an invalid reference.
>
*/
>
OSStatus CoreMenuExtraRemoveMenuExtra(
>
MenuExtraRef inMenuExtra);
>
>
>>> END QUOTED FILE
>
>
PS: Sorry about the cross-post, but I thought it was appropriate. If you
>
think I should ask this question elsewhere, please direct me where.
>
>
Thanks very much,
>
>
--
>
Chris Boot
>
email@hidden
>
>
Your mouse has moved. You must restart Windows NT
>
for this change to be recognized.
>
_______________________________________________
>
cocoa-dev mailing list
>
email@hidden
>
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
!!!!
!!!!!!!!!!!!!!!!
Regards&Thanks!
Tommy Tian
2003-04-24
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.