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

Re: Util to put icon files into a file's resource fork ?



In article <madsci-0310961422540001@ppp-15.ts-13.nyc.idt.net>
madsci@tribeca.ios.com (Erick Dietrich) writes:
>In article <3253B887.794B@sophia.inria.fr>, Frederic Devernay
><Frederic.Devernay@sophia.inria.fr> wrote:
>> IIGS users,
>> I'm tired of having all these icon files in the "icons" folder of my HD,
>> is there a utility to put the icons into a program's resource fork ? I
>> think System 6 handles these... (maybe I'm wrong)
>I've been wondering this myself lately.  It seems like its possible.  Is
>there anything special by way of code that tells the Finder to look into a
>rescource fork to find an rIcon or does the Finder just look?  Does the
>GS/OS Finder have bundle bits like Macintosh System X? (I refuse to call
>it MacOS).

Well...sort of.  If the application has an rBundle resource, it and its
associated rIcon resources will be copied into the Icons:Desktop file of
the disk the application resides on, the first time you run it.  From that
point on, the Finder will display the correct icons for the application and
its files.

>[...]
>Nother question.  I've made up better looking generic folder, .SYS ans
>.SYS16 icons.  I want the finder to use these when it can't find a custom
>file.  However, it seems no matter what I call the file, (which is
>System.Icons), wether I make it a.System.Icons (to make it first) or
>z.System.Icons, or if I leave it as it is, the finder substitutes the
>generic icon for ALL files, and kills the custom ones.  What am I doind
>wrong?

The trick is to put your "better" generic icons as late as possible in the
search order.  When the Finder looks for an icon for a file, it takes the
first match it gets, so if it finds a matching generic icon early on in the
search, it stops there and never looks to see if there's a better custom
match later on in the search order.

As of System 6.0, the search order is as follows:

     1.  the Icons:Desktop file of the boot disk
     2.  the old-style icon files on the boot disk, searched in directory
         (not alphabetical) order, with each file searched front-to-back
     3.  The Icons:Desktop files and old-style icon files of any other
         disk drives, searched in GS/OS-device-number order (and within
         each disk, searched in the same order as above--Desktop file,
         followed by old-style icon files in directory order)
     4.  the Finder's own rBundle resource

So ideally, you would want to put your new generic icons in the Finder's
resource fork.  But Apple officially recommends *not* doing this, so you
have to get in at the end of step 3--i.e. put your generic icons in an
old-style icon file on the highest-numbered available device (if you boot
from a hard drive, this will probably be the last partition of your last
hard drive).

I strongly recommend reading IIGS Technical Note #108, which discusses
(among other things) the icon search order.

               - Neil Parker
-- 
Neil Parker, nparker@{cie-2,cie}.uoregon.edu, http://cie-2.uoregon.edu/~nparker

                     "Bad move, Neil!"  -- The Tick