[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: color icons



At 4:53 PM 4/26/95, Daniel Berger wrote:
>I am having trouble getting color icons (cicn resources) to appear.  I am
>using the icon-dialog-item code (Apple, 1989) which works fine with black
>and white icons (icon resources).
>
>The loaded resources look like ok Mac Handles. I use the following to load
>them (some other old Apple code):
>
>   ;; black and white icons - NNN is the resource ID number
>   (setf *tmp-icon* (#_getresource :ostype :icon :word NNN :ptr)
>   (#_detachresource :ptr *tmp-icon*)
>   ;; color icons
>   (setf *tmp-cicn* (#_getresource :ostype "cicn" :word NNN :ptr)
>   (#_detachresource :ptr *tmp-cicn*)

Use (#_GetCIcon NNN) instead of (#_getresource "cicn" NNN). Don't
#_DetachResource afterwards. When you're done with the icon,
use #_DisposeCIcon to get rid of it

>
>There does not seem to be an ostype :cicn, and no complaints appear with
>"cicn" (I get a valid mac handle)

:cicn is the same as "CICN" as an OSTYPE. When a symbol is interpreted
as an ostype, it's symbol-name is used. The reader upcases symbol names.
:|cicn| is the same as "cicn" since the vertical bars cause the reader
to not mess with case.