Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!henry!hairston From: hairston@henry.ece.cmu.edu (David Hairston) Newsgroups: comp.sys.mac.programmer Subject: Re: Data files with associated icons and owners. Message-ID: Date: 31 Dec 90 17:38:19 GMT References: <2075@njitgw.njit.edu> Organization: Gaia II Lines: 50 In-reply-to: mg5184@mars.njit.edu's message of 31 Dec 90 05:45:11 GMT [mg5184@mars.njit.edu (Michael Gaines) writes:] [] Here's the deal. I've been racking my brains with this and the [] limited number of resources I've had available to me. I'm writing a [] program (no kidding) in which data files are created. I want to know how [] to copy an icon from my ICN# list to be the desktop icon for my data [] file. ALSO, I would have to change the owner of the data file. Please, [] don't kick me if this is something too obvious. I thought there was a [] resource fork at work here, but my data files from MathCAD and Word have [] unique icons and no resource forks. Welcome to Macintosh ... The Finder handles the icon'ing. The gist of the matter is that the Finder oversees a database of file types and associated icons related to a given file creator. Typically, the Finder will look for a file of type APPL and make a note of its creator signature (let's say FOO1). The Finder will then read the applications file reference bundle, a group of resources: BNDL, FREF and ICN# where the BNDL pairs a FREF to a particular ICN#. In this way an application can specify, for example, that all files with type FOO2 and creator FOO1 will have the icon denoted by the BNDL pairing. Thus the document file (FOO2 with creator FOO1) need not have a resource fork, just the right finder info. Here's a concrete example (from memory) for MacDraw: Finder Info: MacDraw macdraw.1 macdraw.2 type APPL DRWG PICT creator MDRW MDRW MDRW Resources: bundle BNDL ref FREF icon ICN# the BNDL assigns MDRW as the creator signature for file types APPL, DRWG and PICT and associates an icon with each type. The Finder copies this info into a private database and does the necessary magic to enable you to see a particular icon for a given file type (and creator). Using finder info calls you can change a files signature (creator and type) so that it will display associated existing icons. You can create icons and bundles, etc. with a resource editor and manipulate them with toolbox calls. For more info you are referred to Inside Macintosh, Vol. III (i think), the section dealing with Finder Info (should be near the beginning). -dave- hairston@henry.ece.cmu.edu