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 > OADockStatusItem

OADockStatusItem
Thread Tools
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 9, 2002, 08:14 AM
 
Does anyone have any code laying around which implements OADockStatusItem? I've looked at the header but got little help. I think I need to initialize it with a badge icon, a number, and a text color but don't know how.
3R1C
     
3R1C  (op)
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 9, 2002, 11:48 PM
 
Where is the Rickster when you need him? Just kidding.
3R1C
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
May 10, 2002, 01:28 AM
 
In San Jose, and running an operating system that OmniAppKit currently won't build on. Will get to this question when I return...
Rick Roe
icons.cx | weblog
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Glasgow
Status: Offline
Reply With Quote
May 10, 2002, 03:49 AM
 
I don't know about text colour, but to get a count and icon you could do something like this:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
OADockStatusItem *dockItem = [[OADockStatusItem alloc] initWithIcon: [NSImage imageNamed: <font color = orange>@"iconBadge"</font>]];
[dockItem setCount: <font color = blue>10</font>];
[dockItem show];
</font>[/code]

Currently, I find it annoying that you can't put an arbitrary string in the badge as I want to put a string like "2:10" in the badge, but hey.

HTH,
Fraser
PowerBook G4 17"
Power Mac G4/800, 1Gb RAM, 80Gb HDD, Superdrive, GeForce 4MX, Gateway 21" CRT, Apple Pro Speakers, iSub - Running Mac OS X Server 10.2
iBook 500, 192MbRAM - Running Mac OS X 10.2
iPod 5Gb
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
May 14, 2002, 07:10 PM
 
Okay, looks like Fraser answered for me. Good.

The current version of OADockStatusItem was (re)written with a very specific purpose in mind... we didn't want to have generalized (and thus untested code) begin added close to the OmniWeb 4.1 release. Of course, you're quite welcome to extend it yourself and submit changes back to us...
Rick Roe
icons.cx | weblog
     
3R1C  (op)
Mac Enthusiast
Join Date: Oct 2001
Status: Offline
Reply With Quote
May 15, 2002, 07:09 PM
 
I've managed to get OADockStatusItem to work. I've also replaced the left center and right tiffs of the badge background in the framework to use a 'Mail.app like' red badge. My only two think left I'd like to modify, are the text color of the number and the icons position. I'd like the text to be white and the badge to centered. I guess I could modify the framework to reflect these changes, as I did the badge, but this seems to be 'cheating' sort of. How does one go about telling OADockStatusItem to use MY tiffs and MY text color and MY badge position? I have no doubt this is probably a very easy thing to do, I just have no idea how to do it.
3R1C
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Glasgow
Status: Offline
Reply With Quote
May 17, 2002, 05:40 AM
 
Originally posted by Rickster:
<STRONG>Okay, looks like Fraser answered for me. Good.

The current version of OADockStatusItem was (re)written with a very specific purpose in mind... we didn't want to have generalized (and thus untested code) begin added close to the OmniWeb 4.1 release. Of course, you're quite welcome to extend it yourself and submit changes back to us... </STRONG>
I was having a look at this today, but it seems that OmniAppKit won't compile with the new Proejct Builder release:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>#define NSSTRINGIFY(name) @ ## '<font color = red>"' ## name ## '"</font>'
</font>[/code]

seems to barf:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
Widgets.subproj/OAAquaButton.m:<font color = blue>167</font>: illegal expression, found `@'
cpp-precomp: warning: errors during smart preprocessing, retrying in basic mode
Widgets.subproj/OAAquaButton.m:<font color = blue>167</font>: invalid identifier `@'
Widgets.subproj/OAAquaButton.m:<font color = blue>167</font>: `@' undeclared here (not in a function)
Widgets.subproj/OAAquaButton.m:<font color = blue>167</font>: parse error before character constant
</font>[/code]
PowerBook G4 17"
Power Mac G4/800, 1Gb RAM, 80Gb HDD, Superdrive, GeForce 4MX, Gateway 21" CRT, Apple Pro Speakers, iSub - Running Mac OS X Server 10.2
iBook 500, 192MbRAM - Running Mac OS X 10.2
iPod 5Gb
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
May 17, 2002, 05:08 PM
 
The NSSTRINGIFY problem only occurs if you're using the gcc3 compiler. Switch back to gcc 2.95 and you'll be fine.

Remember, you should only use the beta gcc3 compiler in the April tools for evaluation purposes, not for shipping code -- it's not just a good idea, it's stipulated by the License Agreement on the Developer Tools.

You can pretty easily work around the problem to get the Omni frameworks to build, though... just manually expand the NSSTRINGIFY macro in all the files that use it.

[edit: corrected myself about code releases to fix the problem]

[ 05-17-2002: Message edited by: Rickster ]
Rick Roe
icons.cx | weblog
     
Dedicated MacNNer
Join Date: Nov 2000
Location: Glasgow
Status: Offline
Reply With Quote
May 18, 2002, 02:02 AM
 
Hmmm...I thought you had to explicitly choose GCC3 in a build setting, which I didn't do. I wasn't intending to use GCC3, so I'll check that again.....

Fraser
PowerBook G4 17"
Power Mac G4/800, 1Gb RAM, 80Gb HDD, Superdrive, GeForce 4MX, Gateway 21" CRT, Apple Pro Speakers, iSub - Running Mac OS X Server 10.2
iBook 500, 192MbRAM - Running Mac OS X 10.2
iPod 5Gb
     
   
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:56 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2