[futurebasic] Re: [FB] re: Resource Question

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2004 : Group Archive : Group : All Groups

From: Joe Lewis Wilkins <PepeToo@...>
Date: Thu, 07 Oct 2004 15:02:21 -0700
So it seems that we (Apple) have finally succumbed to the odious 
approach of having dozens, neigh perhaps hundreds, of externals files 
that contain globs of "data" used by our applications; rather than the 
really neat hidden resources approach that Apple initially concocted, 
one of the features that really made Mac apps unique and less 
susceptible to user screw-ups - like deleting or relocating a needed 
piece of information. I really don't cotton to this "new" approach. Am I 
such an "old dog"? Is this "new" approach inevitable? Admittedly, when I 
did a PC version of my apps with Virtual PC and Visual Basic, I ended up 
doing just that, but my Mac versions were several times smaller and ran 
faster than the PC version. I'm inclined to think that an application 
accesses data from a resource fork faster than it does from an external 
file. Once again, am I all wet?

Joe Wilkins

H. Gluender wrote:

>>>  There is nothing FB-specific with the plst resource.
>>
>
>>  Does an FB application use plst or does the OS use an FB
>>  application's plst file? If so, then I would like to see an example.
>
>
> The "info plist" we are speaking of mainly serves as a substitute of 
> the BNDL and FREF resources. Hence it must contain at least comparable 
> data -- and all of the examples in Apple's doc do so.
>
>>>  Please read Apple's TN 2013 "The 'plst' resource". It provides 
>>> examples.
>>
>
>>  Okay,
>
>
>     http://developer.apple.com/technotes/tn/tn2013.html
>
> Excellent!
>
>>  I read that it's a text file with a bunch of key values and such -- I
>>  get that.  But as to where to put it, it's as clear as mud. Do I use
>>  Resorcerer to make a plst resource in the .rsrc file in my
>>  development folder OR do I make a text file and place it in bum-butt,
>>  Iowa, or what?
>
>
> It's much easier than you think:
>
> If you create a bundled app, then the "info plist" would be a text 
> file and would reside with many other files in the special folder that 
> makes up the bundle.
>
> I presume that presently you stick with a single file executable with 
> resource fork. In this case the text file goes into the "plst" 
> resource of number 0. You can do this with good old ResEdit. Copy the 
> "info plist" text file to the clipboard and paste the data into the 
> empty "plst" resource. Make sure you have selected the ascii portion 
> (right hand side) of the ResEdit hexeditor window.
>
> Everything in Andorra now?
>
> ----------------------------------
>
>>>  I fear this handling of prefereces (which is based on FB's prefs
>>>  handling) is no longer up-to date.
>>
>
>>  Arrgggg!  Now that I finally got it working, you tell me that it's no
>>  longer up-to date.
>
>
>>  What I would like is simply something that would make saving
>>  preferences simple, like maybe fn savePrefs and a fn loadPrefs.
>
>
> You seem to have a working solution, so be happy...
>
>>>  For the really easy to use prefs-concept that Apple provides
>>>  (CoreFoundation Preferences) see the Apple docs:
>>>  "Preferences Utilities Reference" and "Introduction to Preferences"
>>>  Furthermore, there is my FB-"PassWord_Demo" on the DropBox that
>>>  shows how easy it is to use CoreFoundation Preferences.
>>>  Please let me know if you need the corresponding FB-header files.
>>
>
> I recommend to read Apple's "Introduction to Preferences" which is a 
> concise html-only document. Then you can decide whether you like to 
> adopt the up-to-date CFPreferences-concept. This concept is as easy as 
> I can imagine that one could make it. Every item (text, number, etc.) 
> you should like to store in the preferences is linked to a 
> corresponding keyword of your choice. Just enter it to the appropriate 
> routine and you get the desired item back... You don't have to care 
> about the data-organization in and the writing of the data to the 
> prefs-file and about where to save it. The prefs-file is even deleted 
> automatically when it is empty. It's simply wonderful.
>
>>  As always, I have problems accessing the FB Drop-box. Every time I go
>>  there, I see nothing but a Drop Box Folder with nothing inside.
>
>
> If you've decided to use CFPreferences, then please let me know and 
> I'll send you the project privately.
>
> Happy coding