From: Philip A. <phi...@sh...> - 2007-12-12 00:35:39
|
On Dec 11, 2007, at 9:02 AM, Uwe Kirschner wrote: > Thanks for pointing out Tclresource to me! > This is a great package and I did experiment with it but in the end =20= > I had to abandon the 'pnot' approach altogether since it turns out =20 > that the file open dialog uses the 'pnot' resource but the finder =20 > window doesn't. > Finally I found SetCustomIcon.c at developer.apple.com which uses =20 > an 'icns' resource instead of 'pnot'. This gave me a starting =20 > point. I skipped all of the UI and QT stuff in the example and just =20= > used the functions that store the icon in the resource fork. I pass =20= > in the pixelPtr of a photo image and convert from RGBA to ARGB. One =20= > must still create a mask image from the photo's alpha channel. > The reason for this approach - although somewhat old-fashioned - =20 > is that the 'icns' preview icon will be displayed in the finder =20 > window als well as in the tk_getOpenFile dialog with no need for =20 > any further programming. Hi Uwe, Actually I didn't know that using a custom 'icns' is a substitute/=20 fallback/replacement for 'pnot'. Otherwise I probably would have =20 mentioned that the built-in tool 'sips' which when called as 'sips -i =20= file [file =E2=80=A6]' will generate the custom icns resource from many =20= image formats. This could save you some bother in the future because =20 the example code is using obsolete calls -- some of which I think are =20= completely removed in Leopard. Philip Aker echo astwta@lvpc.dslh@nl | tr a-z@. p-za-o.@ |