PDA

View Full Version : Developers and Programming i need your assistance.




mrbaseball0909
Sep 3, 2010, 05:03 PM
So i've tried researching this for myself by doing system traces etc.. Mac Mail, iChat and other programs call a red badge when one has a new message or piece of mail.

I would like to edit the badge to a different image if possible. Only problem is i don't know where the programs are calling it from. Is it a system wide resource or part of the application contents?

I appreciate it.



robbieduncan
Sep 3, 2010, 05:04 PM
Each app is doing it itself. Most are probably drawing it using code in Quartz. So you won't be able to change it.

lee1210
Sep 3, 2010, 05:22 PM
In 10.5 and up setBadgeLabel: is available:
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/NSDockTile_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDockTile/setBadgeLabel:

-Lee

mrbaseball0909
Sep 3, 2010, 05:39 PM
In 10.5 and up setBadgeLabel: is available:
http://developer.apple.com/mac/library/documentation/Cocoa/Reference/NSDockTile_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDockTile/setBadgeLabel:

-Lee

Thanks for the info Lee, but i must apologize i do not understand all of it. Will i be able to find the location of the image to change it? Or is it something i cannot change?

chown33
Sep 3, 2010, 05:51 PM
When you say "a different image", do you mean something other than a red circle? Such as "change it to a blue rectangle".

Because unless there is other evidence, there is no compelling reason to think there is an image-file stored anywhere that contains a red circle. It is entirely possible, even plausible, that the red circle is being created entirely in code. That would mean its redness and its circularity are not editable.

I know of no evidence that there is or isn't a file. Nor do I know of evidence it's done in code. Either way, it would take some significant digging into the system guts to discover evidence one way or the other.

mrbaseball0909
Sep 3, 2010, 06:25 PM
When you say "a different image", do you mean something other than a red circle? Such as "change it to a blue rectangle".

Because unless there is other evidence, there is no compelling reason to think there is an image-file stored anywhere that contains a red circle. It is entirely possible, even plausible, that the red circle is being created entirely in code. That would mean its redness and its circularity are not editable.

I know of no evidence that there is or isn't a file. Nor do I know of evidence it's done in code. Either way, it would take some significant digging into the system guts to discover evidence one way or the other.

Yes i am trying to make it a coin or diamond etc..

I have found other items on the system - dragBadge, ty-badge and more that are the same exact image. i changed the drag badge file and when i drag around multiple messages in mail it displays a blue diamond instead of the red circle badge.

I have not been able to locate the file that the dock uses though to change that file.

foidulus
Sep 3, 2010, 07:12 PM
From http://developer.apple.com/mac/library/documentation/Cocoa/Reference/NSDockTile_Class/Reference/Reference.html

If you want anything other than badge labels you have to draw the entire view yourself using an NSView. So here is a rough outline of the code:

NSView *mySuperDockTile; //Set up your view here
NSDoctkTile *tile=[[NSApplication sharedApplication] dockTile];
[tile setContentView:mySuperDockTile];

Call this whenever you change the view(add icon, remove icon etc)
[tile display];


Hope this helps.

robbieduncan
Sep 4, 2010, 04:12 AM
From http://developer.apple.com/mac/library/documentation/Cocoa/Reference/NSDockTile_Class/Reference/Reference.html

If you want anything other than badge labels you have to draw the entire view yourself using an NSView. So here is a rough outline of the code:

NSView *mySuperDockTile; //Set up your view here
NSDoctkTile *tile=[[NSApplication sharedApplication] dockTile];
[tile setContentView:mySuperDockTile];

Call this whenever you change the view(add icon, remove icon etc)
[tile display];


Hope this helps.

He's trying to do this system wide on apps he doesn't write/have the code for.