Fwd: Print a number on the file icon.
Fwd: Print a number on the file icon.
- Subject: Fwd: Print a number on the file icon.
- From: Marco Binder <email@hidden>
- Date: Sun, 8 Jun 2003 18:32:04 +0200
You have to look into the NSString additions in AppKit. With those, you
can directly draw a string into a focused view or image. I presume you
know how to get a number into an NSString. For the attributes used to
draw the text, have a look at NSAttributedString in Foundation. For any
fancy image composition, like in Mail.app, where the number is put onto
a this red spot which is then composed ontop of the app s icon, i
suggest drawing the red spot into a separate image, then the number on
top of that into the same image and then composit this image ontop of
the app s icon image. For that, have a look into NSImage, especially
the composit.... methods. To get and to set the app s icon image, have
a look at NSApplication (applicationIconImage). I doubt, you can easily
change the iconthat represents the app in the finder (due to icon
caching and co), but the dock icon will be updated accordingly.
If you want to permanently change the app s icon file, thats gonna be a
problem. You d have to find a way to produce icon files from an NSImage
(I dont know of a way) and replace the ApplicationIcon file in your app
s bundle. And even then, the finder would reflect the change only after
restart I guess.
Marco
Am Sonntag, 08.06.03, um 12:02 Uhr (Europe/Berlin) schrieb Lorenzo:
>
Hi,
>
just to add a fine touch to the files icon my application saves, I
>
would
>
like to add on the fly a "number" on the file icon.
>
For example, if the document saved contains 130 addresses, I would
>
like to
>
print on the icon "130". So I presume I have to mix the icon image
>
with the
>
number image and save the file with that icon. But I have no idea about
>
transforming a number into an image and mix the two images, and change
>
the
>
default icon on the fly...
>
>
Some idea?
>
>
>
Best Regards
>
--
>
Lorenzo
>
email: email@hidden
>
_______________________________________________
>
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.
>
--
|\ /| email@hidden
http://www.marco-binder.de
| \/ | Telefon: 07531 / 94 19 94 Fax: 07531 / 94 19 92
| |ARCO Snail-Mail: Banater Str. 3 - 78467 Konstanz
BINDER _____________________________________________________
_______________________________________________
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.