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 > StatusBar ala PTHClock?

StatusBar ala PTHClock?
Thread Tools
parallax
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 28, 2002, 03:10 AM
 
Hey guys... I want to make an NSStatusBar to the right of the date/time and volume control items. I assume this has something do with the _fPriority of the NSStatusIem, but I don't know what to do (I tried setting _fPriority, but no value seemed to work).

There's this +statusItemWithLength:withPriority: hidden in the AppKit binary, but no mention of it in the headers. When I run my app, it complains that that method doesn't exist.

Help!
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
seb2
Grizzled Veteran
Join Date: Feb 2001
Location: Germany
Status: Offline
Reply With Quote
Mar 28, 2002, 11:05 PM
 
to be honest, i don't quite completely understand your problem. what's always worked nicely for me was to write an app that does nothing else but to put a menu up there.

i found that global menu demo was a good starting point. i could post examples if you want me to.
     
parallax  (op)
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 29, 2002, 01:14 AM
 
Sorry, I wrote that when I was extremely tired (whoops, I'm about to sleep now too, but hey, I'll try again ).

What I meant was that the menu should be to the right of the date status item, not to the left. The factory NSStatusBar method places it to the left.

[fixed typo...]

[ 03-29-2002: Message edited by: parallax ]
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 29, 2002, 02:27 PM
 
There is no public API to do what you want, AFAIK.
     
parallax  (op)
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 29, 2002, 07:08 PM
 
Originally posted by Angus_D:
<STRONG>There is no public API to do what you want, AFAIK.</STRONG>
Nope, no public API. But there are other ways than public methinks...
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 30, 2002, 07:24 AM
 
Originally posted by parallax:
<STRONG>Nope, no public API. But there are other ways than public methinks... </STRONG>
You'll probably need to be a Menu Extra, see how ASM accomplishes it (source code from http://asm.vercruesse.de). I wouldn't be surprised if Apple breaks this for 10.2, though

Edit: UBB's URL detection code is crap.

[ 03-30-2002: Message edited by: Angus_D ]
     
Angus_D
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Mar 30, 2002, 07:29 AM
 
By the way, to use methods that aren't declared in public headers, just declare them in a category or something. Like:
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>@interface @interface NSStatusItem(PrivateStuffInAppKit)
+ _itemInStatusBar:fp12 withLength float)fp36 withPriority int)fp20;
@end</font>[/code]
     
parallax  (op)
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 30, 2002, 04:24 PM
 
Haha, I accidentally typed priority: in the code instead of withPriority:... Oh well, that explains it.

I'm fairly certain that PTHClock doesn't use a MenuExtra, because it's launched from an app, unlike ASM which is somewhat "installed" as a MenuExtra (I think)...

Digging through the binary of PTHClock produced a reference to the :withPriority: method, but no value seems to work correctly for me.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
parallax  (op)
Admin Emeritus
Join Date: Oct 2000
Location: Boston, MA
Status: Offline
Reply With Quote
Mar 30, 2002, 04:32 PM
 
NEVERMIND.
Disassembling PTHClock produced 0xbfff.

Okay, you all should know how to do this so I'll post it in another thread.
"Against stupidity, the gods themselves contend in vain" (Schiller)
     
   
 
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 04:57 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.,