On Jul 9, 2008, at 10:07 PM, Chris Idou wrote:
I came up with the code below to set the color label. Questions:1) Is it really necessary to do a FSGetCatalogInfo first? I presume it is because otherwise the FSSetCatalogInfo wouldn't know what fields of catalogInfo.finderInfo it is supposed to be updating, or even what bits of catalogInfo.fileInfo->finderFlags.
I believe that's correct.
2) I'm casting finderInfo to a (FileInfo *). But from the header files it also mentions the FolderInfo structure in conjunction with the finderInfo member. From my looking at FileInfo and FolderInfo it appears as if the finderFlags are at different offsets in the structures. Am I supposed to check if it is a directory and cast it to one or the other depending on the result?
I think they're actually at the same offset; the Rect in FolderInfo has 4 short members (8 bytes), which should be the same size as the two OSType members in FinderInfo (4 bytes each). In spite of that, I cast appropriately so I can see what's going on. It's too late for me to think clearly, so I'll just point you to my own code for getting/ setting labels: http://code.google.com/p/fileview/source/browse/trunk/fileview/FVFinderLabel.m (BSD license).
hth, Adam
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]