Arrays and Custom Props
Mark Swindell
mdswindell at cruzio.com
Mon Feb 16 17:10:52 EST 2009
Bob,
You're right, I'm not clear what you're saying. :) First off, I'm not
one of the illuminati on this list by a long shot. But I do think I
have a grasp of a couple of concepts, and I'll be corrected if I'm
wrong.
Properties are associated with objects.
Objects come with a set of built in properties. (height, width,
visible, etc.)
On top of that a user can create a new "custom" property for any given
object (button, field, card, stack, etc.) simply by declaring it.
These are custom properties. They are associated with the object you
associate them with, and remain so.
The exception to the above is that if you make any change to an
executable (a standalone), including adding a card, a button, changing
an objects properties (custom or innate), that change will not be
saved when the executable quits. But this only affects the executable
stack.
A SUBSTACK of the executable, as long as it is saved as a separate
file when the standalone is created, can be saved, and it's changes
will be saved. You have to save it deliberately by issuing the
command "save this stack" in some form or another, but those changes
will be saved.
Now, when the executable opens and calls for that substack to open,
the substack will appear with all changes intact. That's why the
splash stack is often used for this purpose. It is the executable,
but all associated substacks, as long as they were saved as separate
substacks by checking the "move substacks to individual files" (or
whatever is is) in the application builder are modifiable and those
modifications persist. Including custom properties.
Maybe this is all clear to you and I'm just not understanding, but in
any case...
Thanks,
Mark Swindell
On Feb 16, 2009, at 1:46 PM, Bob Sneidar wrote:
> Sorry all didn't make myself clear. The "oddity" was not that Mac
> apps are packages. The "oddity" is that the properties cannot be
> saved when you quit the app because they are (ostensibly) part of
> the executable. I believe that was the reason given for the fact
> that a revolution executable property set would not survive a quit
> and relaunch (when in fact an Applescript executable's properties
> are saved).
>
> If that is not the case, if the properties are not attached to the
> executable, then there really isn't a reason why the app cannot
> store properties inside the package, or at least save them on
> quitting the app.
>
> But that is a story for another thread. This is really academic as I
> can write my own property saving method, or even use low level file
> functions inside the package to accomplish the same thing.
>
> Bob Sneidar
> IT Manager
> Logos Management
> Calvary Chapel CM
>
> On Feb 16, 2009, at 11:55 AM, Richard Gaskin wrote:
>
>> Bob Sneidar wrote:
>>> Oh gotcha! So you are saying that the properties are something
>>> that is a part of the executable inside the package? How odd.
>>
>> The confusion stems from OS X lying to us: it tells us that an
>> application is a file, when it's really a folder. :)
>>
>> The actual executable (the runtime engine bound to your stack) is
>> inside that folder in /Contents/MacOS/. That executable is
>> essentially the same as you get on Win and Linux, except that on OS
>> X it's buried inside of these other folders comprising the
>> "bundle". This executable cannot modify itself at runtime, and I
>> don't believe any of the supported OSes allow any executable to
>> modify themselves.
>>
>> But as you've found, just about any data file be modified,
>> including those stored in the bundle (with appropriate permissions).
>>
>> While it's possible to write data into the bundle, the OS X HIG
>> suggests using the Application Support folder or Preferences for
>> that. The equivalent to Application Support in Win is Application
>> Data. You can get the paths to these using Rev's specialFolderPath
>> function:
>>
>> -- OS X: Application Support
>> get specialFolderPath("asup")
>>
>> -- OS X: Preferences:
>> get specialFolderPath("preferences")
>>
>> -- Win: Application Data:
>> get specialFolderPath(26)
>>
>> For a complete list of constants for special folders on OS X and Win:
>> <http://sonsothunder.com/devres/revolution/tips/file010.htm>
>>
>> As Paul noted, one advantage to storing your user's data outside of
>> the bundle is that they can upgrade the application without losing
>> their data.
>>
>> --
>> Richard Gaskin
>> Fourth World
>> Revolution training and consulting: http://www.fourthworld.com
>> Webzine for Rev developers: http://www.revjournal.com
>> _______________________________________________
>> use-revolution mailing list
>> use-revolution at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-revolution
>
>
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
More information about the use-livecode
mailing list