Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: resource question



On 5/30/03 2:34 PM, Bob Sabiston didst favor us with:

> Hello,
> I am trying to retrieve a resource from a preferences file, after
> setting UseResFile(). UseResFile returns with no error, and my
> resource is retrieved just fine. The problem is, that resource isn't
> *actually in* the preferences file. It must be getting it from
> somewhere else, right? The default resource file is that of the
> application itself, isn't it?

No, there is not "default" resource file. An application can have multiple
resource files open in what is called the resource file chain. UseResFile()
puts a file at the top of the chain (by default the last resource file
opened is at the top of the chain). When you try to load a resource, the
Resource Manager looks for it initially at top of the chain, and if it
doesn't find the desired resource, it looks in the next file in the chain
and so on. In single file applications with a resource fork in classic OSs,
the System file and your applications resource fork were always in the
chain, with your resource fork initially at the top.

This is all well documented stuff, by the way, having not changed much since
1984.

> Or does it look at the resource file in
> the resources folder of my freaky new bundled app which is really a
> folder?

If your application is bundled, then it's likely your application file has
no resource fork and the resources are being placed in a separate data fork
based resource file, possibly two of them, a main resource file and a
localized resource file.

> Or does system 9 check the preference file in the system
> folder?

If you have a preferences file with a resource fork and you've opened it,
it's in the chain and could be searched.

> I have my Mac set to a single user, this is in OS9. I have
> looked at all of these resource files with ResEdit, and the resource is
> not actually in any of them.
> So where else could the resource manager be finding this resource?
>
> The only thing I am not sure about is that in my freaky new bundle app
> folder,

Okay, could you spare us the "freaky" thing?

> there is the Resources folder I mentioned, and a resource file
> in there. I didn't put it there, but maybe CodeWarrior did when I
> wasn't looking. I can't open the file with ResEdit, it says there's no
> resource fork to it. Could there be resource information in the DATA
> fork,

Absolutely.

> that resedit can't find,

ResEdit hasn't been updated in years and doesn't know about data fork based
resource files.

> that was put there during some old compile?
>
> I have checked as many places as I know, and can't find it any files!
> Yet it is getting it, correct from somewhere. I need to know because I
> don't really want it there anymore.

What don't you want there anymore, the resource or the data fork resource
file?

Larry
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.

References: 
 >resource question (From: Bob Sabiston <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.