Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > *** How to make a StatusBar to the right of the time.

*** How to make a StatusBar to the right of the time.
Thread Tools
parallax
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 30, 2002, 04:49 PM
 
Alrighty, I know some people (including me) have wondered how you create a space to the right of the time in the menubar like PTHClock does.

This is an alternative to the MenuExtra method used by ASM, which requires you to use a bunch of hacks (as if this is not one). The source code for ASM is available at http://x-asm.sourceforge.net/ .

Declare an "NSStatusItem *menuStatusItem."

Then,
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
globalMenu = [NSStatusBar systemStatusBar];
menuStatusItem = [[globalMenu _statusItemWithLength:<font color = blue>100.</font> withPriority:0xbfff] retain];
[menuStatusItem setTitle:<font color = orange>@""</font>];
[menuStatusItem setMenu:menu];
</font>[/code]

0xBFFF is the value I found disassembling PTHClock, so I don't quite know what that value signifies.

Bon appetit.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
Thread Tools
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 06:41 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,