Do resources have to be added manually?

Using Standalone Maker to build executables or delivering projects for use with the SuperCard Player? Discuss it here.

Do resources have to be added manually?

Postby drpitcairn » Sun Nov 13, 2011 8:18 am

I notice when I do a "check" in a build that the tab for resources stays yellow and there are no resources listed in the window. However, in the project I am running I have already added the resources I want. So that is sufficient, isn't it? I mean I don't have to add them again in the build do I?
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Do resources have to be added manually?

Postby Lisa » Sun Nov 13, 2011 9:35 am

You don't need to do anything on that tab with regard to the resources you've installed directly into the data fork of the project. If you have any external resource files to which your project needs access, eg. image files, icon files, sound files, font files, etc., then you can add those to the list and SaM will copy them into the standalone's application package.
iMac 24" 3.06 GHz Intel Core 2 Duo, 4 GB RAM, Mac OS X 10.6.8, SC 4.7.3
User avatar
Lisa
 
Posts: 303
Joined: Sun Jul 06, 2008 12:33 pm
Location: San Diego, CA

Re: Do resources have to be added manually?

Postby drpitcairn » Sun Nov 13, 2011 9:53 am

I have already added the image files for buttons. Here is a picture of the resources window. Looks right?
resources.gif
project resources
resources.gif (35.73 KiB) Viewed 3706 times


Should I move the PICT green ticket over to resources? Or does it matter?
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Do resources have to be added manually?

Postby Lisa » Mon Nov 14, 2011 12:54 am

drpitcairn wrote:I have already added the image files for buttons. Here is a picture of the resources window. Looks right?
Should I move the PICT green ticket over to resources? Or does it matter?

Looks right, except that I've never had much cause to use PICT resources in the kinds of projects I write so I can't really answer the question. Why did you install it in the data fork and the other PICTs in the resource fork in the first place? I notice there is already a "green ticket2" PICT in the resource fork -- is it possible that one or the other is extraneous, or are they being used for different things? It's not going to hurt anything to have an extraneous resource, except adding some bytes to the file size, so it might not be worth worrying about. Only you can know the real test, which is if the resources do what you expect them to do when referenced in your scripts or, in the case of images and icons, when drawn on button and graphic objects.
iMac 24" 3.06 GHz Intel Core 2 Duo, 4 GB RAM, Mac OS X 10.6.8, SC 4.7.3
User avatar
Lisa
 
Posts: 303
Joined: Sun Jul 06, 2008 12:33 pm
Location: San Diego, CA

Re: Do resources have to be added manually?

Postby drpitcairn » Mon Nov 14, 2011 7:59 am

The reason that some resources are in data fork and others in resource fork is because I don't know what I am doing. Is there a rule about which should be in which category? I can't seem to figure it out from the user manual.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Do resources have to be added manually?

Postby Scott » Mon Nov 14, 2011 8:56 am

There is no hard rule… but I always refrain from putting things in the resource fork unless they have to go there. My main reasoning for this is that other file systems don't support resource forks so should your project pass through one of them (thumb drive, email, unix based server, etc.) the resource fork will be destroyed.

I don't recall if there are still some internal resources that need to be accessed from the resource fork, but if there are it will be stated in the language guide for the related keyword you are using to access it. For instance, this snippet from the pictureData entry:

If the to resource option is used, the PICT image comes from a resource of type 'PICT'. If the value in resNameOrID can evaluate to a numeric value, SuperCard will interpret resNameOrID as a resource ID; if it can be evaluated as an alphanumeric value, SuperCard will interpret resNameOrID as a resource name. You may optionally specify the file from which the ‘PICT’ resource is to be imported by using the of [file] fileName option, passing a valid path name for fileName. If you do not use this option, it is assumed that the ‘PICT’ resource is in the current project’s resource fork, or the resource fork of the SharedFile.

If the to data option is used, the PICT image must come from a data-fork resource of type 'PICT', whose name is stored in resName. The 'PICT' resource must be in the current project’s data fork.
User avatar
Scott
Site Admin
 
Posts: 1217
Joined: Sat Jul 05, 2008 1:37 pm
Location: Northern Sierra Nevada

Re: Do resources have to be added manually?

Postby drpitcairn » Mon Nov 14, 2011 9:18 am

Great. Good to know about the possible loss of resources.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona

Re: Do resources have to be added manually?

Postby Lisa » Mon Nov 14, 2011 9:42 am

I'm glad Scott posted because I wasn't comfortable telling you that it's better to install resources in the data fork without having a strong background knowledge as to why. Another advantage of data fork resources is that they're manageable in SuperEdit -- you can see the full list there and cut, copy and paste between projects, etc. The one usage I know of where Supercard seems to want the resource in the resource fork is using PICTs as icons on certain types of buttons. So I was concerned that might be the case here.
iMac 24" 3.06 GHz Intel Core 2 Duo, 4 GB RAM, Mac OS X 10.6.8, SC 4.7.3
User avatar
Lisa
 
Posts: 303
Joined: Sun Jul 06, 2008 12:33 pm
Location: San Diego, CA

Re: Do resources have to be added manually?

Postby drpitcairn » Mon Nov 14, 2011 10:07 am

I do have some PICTS on buttons. I will experiment, perhaps move all of them to the data side and see if it works.
User avatar
drpitcairn
 
Posts: 1023
Joined: Thu Apr 02, 2009 9:39 am
Location: Sedona, Arizona


Return to Building Standalones

Who is online

Users browsing this forum: No registered users and 1 guest