Changing Script In Standalone

classic Classic list List threaded Threaded
26 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Changing Script In Standalone

Bridger Maxwell
Hey,
  In one of my programs I use the "Set the script of object to string" alot,
but when I recently switched over to 2.7.1 Studio and started to make
standalone programs, I noticed that this no longer works.  For my test I
made a field and two buttons, one button set the script of the other button
to the field.  I typed a simple on mouseUp handler that answers a message.
It worked when I did it in the development environment, but not as a
standalone.  Does this mean that I can't change script from the
user-interface after it has been saved as a standalone?  Can someone give me
the basic rundown of how Revolution compiles stacks into a standalone?

  TTFN (ta-ta-for-now)
   Bridger
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Dan Shafer-2
Bridger....

At leat part of the problem is that Revolution does not permit on-the-fly
modification of data of any kind in a stack (app) at runtime in the
standalone environment. You get around that particular limitation by storing
the changeable data in a sub-stack of your app's mainstack and setting up
standlone settings so that it creates that stack separately as well. Then
you may be able to tell a button in mainstack to set a script in a button of
a substack but I haven't tested that idea.

On 5/1/06, Bridger Maxwell <[hidden email]> wrote:

>
> Hey,
>   In one of my programs I use the "Set the script of object to string"
> alot,
> but when I recently switched over to 2.7.1 Studio and started to make
> standalone programs, I noticed that this no longer works.  For my test I
> made a field and two buttons, one button set the script of the other
> button
> to the field.  I typed a simple on mouseUp handler that answers a message.
> It worked when I did it in the development environment, but not as a
> standalone.  Does this mean that I can't change script from the
> user-interface after it has been saved as a standalone?  Can someone give
> me
> the basic rundown of how Revolution compiles stacks into a standalone?
>
>   TTFN (ta-ta-for-now)
>    Bridger
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
>From http://www.shafermediastore.com/tech_main.html
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Stephen Barncard
It should be mentioned that there are script limits in a standalone.
10 lines, as I remember.

sqb


>Bridger....
>
>At leat part of the problem is that Revolution does not permit on-the-fly
>modification of data of any kind in a stack (app) at runtime in the
>standalone environment. You get around that particular limitation by storing
>the changeable data in a sub-stack of your app's mainstack and setting up
>standlone settings so that it creates that stack separately as well. Then
>you may be able to tell a button in mainstack to set a script in a button of
>a substack but I haven't tested that idea.
>
>On 5/1/06, Bridger Maxwell <[hidden email]> wrote:
>>
>>Hey,
>>   In one of my programs I use the "Set the script of object to string"
>>alot,
>>but when I recently switched over to 2.7.1 Studio and started to make
>>standalone programs, I noticed that this no longer works.  For my test I
>>made a field and two buttons, one button set the script of the other
>>button
>>to the field.  I typed a simple on mouseUp handler that answers a message.
>>It worked when I did it in the development environment, but not as a
>>standalone.  Does this mean that I can't change script from the
>>user-interface after it has been saved as a standalone?  Can someone give
>>me
>>the basic rundown of how Revolution compiles stacks into a standalone?
>>
>>   TTFN (ta-ta-for-now)
>>    Bridger

--
stephen barncard
s a n  f r a n c i s c o
- - -  - - - - - - - - -
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Jim Ault
Correct on the 10 'statement' limit.
You may need to use
create a sub stack,  set the script of the stack, then
start using stack 'substackname'.  You are allowed 50 stacksInUse.

>From the Docs (2.6.1 Mac)------------------------------------------

Returns the limits on script length for scripts that are edited in a
Revolution.

the scriptLimits
scriptLimits()

Description
Use the scriptLimits function to determine the limits on changing scripts
when using standalone applications created with Revolution.

Value:
The scriptLimits function returns a comma-separated list of four positive
integers. Where 0 occurs in the list it indicates that the limit is
unchecked and therefore unlimited.

Comments:
The four numbers returned by the scriptLimits function are:

* the number of statements permitted when changing a script (normally 10 in
a standalone application)
* the number of statements permitted in a do command (normally 10 in a
standalone application)
* the number of stacks permitted in the stacksInUse (normally 50 in a
standalone application)
* the number of objects permitted in the frontScripts and backScripts
(normally 10 in a standalone application)

  Important!  The first number does not limit scripts that are already
written. In other words, standalone applications can run scripts of any
length. However, if the standalone attempts to change an object's script
property, and the script contains more than the allowable number of
statements, the attempt to set the script causes an error.


On 5/1/06 8:52 PM, "Stephen Barncard" <[hidden email]>
wrote:

> It should be mentioned that there are script limits in a standalone.
> 10 lines, as I remember.
>
> sqb
>
>
>> Bridger....
>>
>> At leat part of the problem is that Revolution does not permit on-the-fly
>> modification of data of any kind in a stack (app) at runtime in the
>> standalone environment. You get around that particular limitation by storing
>> the changeable data in a sub-stack of your app's mainstack and setting up
>> standlone settings so that it creates that stack separately as well. Then
>> you may be able to tell a button in mainstack to set a script in a button of
>> a substack but I haven't tested that idea.
>>
>> On 5/1/06, Bridger Maxwell <[hidden email]> wrote:
>>>
>>> Hey,
>>>   In one of my programs I use the "Set the script of object to string"
>>> alot,
>>> but when I recently switched over to 2.7.1 Studio and started to make
>>> standalone programs, I noticed that this no longer works.  For my test I
>>> made a field and two buttons, one button set the script of the other
>>> button
>>> to the field.  I typed a simple on mouseUp handler that answers a message.
>>> It worked when I did it in the development environment, but not as a
>>> standalone.  Does this mean that I can't change script from the
>>> user-interface after it has been saved as a standalone?  Can someone give
>>> me
>>> the basic rundown of how Revolution compiles stacks into a standalone?
>>>
>>>   TTFN (ta-ta-for-now)
>>>    Bridger


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Sarah Reichelt-2
In reply to this post by Dan Shafer-2
This is not quite true. Rev does permit modification of data in a
standalone, but this new data will not be saved unless it is a
separate file to the main program. This can be a sub-stack or any
external data storage mechanism.

In this case, the script change should happen, provided it fits within
the scriptLimits, but the new script will not be saved if the stack
being modified is part of the main application file.

Cheers,
Sarah

On 5/2/06, Dan Shafer <[hidden email]> wrote:

> Bridger....
>
> At leat part of the problem is that Revolution does not permit on-the-fly
> modification of data of any kind in a stack (app) at runtime in the
> standalone environment. You get around that particular limitation by storing
> the changeable data in a sub-stack of your app's mainstack and setting up
> standlone settings so that it creates that stack separately as well. Then
> you may be able to tell a button in mainstack to set a script in a button of
> a substack but I haven't tested that idea.
>
> On 5/1/06, Bridger Maxwell <[hidden email]> wrote:
> >
> > Hey,
> >   In one of my programs I use the "Set the script of object to string"
> > alot,
> > but when I recently switched over to 2.7.1 Studio and started to make
> > standalone programs, I noticed that this no longer works.  For my test I
> > made a field and two buttons, one button set the script of the other
> > button
> > to the field.  I typed a simple on mouseUp handler that answers a message.
> > It worked when I did it in the development environment, but not as a
> > standalone.  Does this mean that I can't change script from the
> > user-interface after it has been saved as a standalone?  Can someone give
> > me
> > the basic rundown of how Revolution compiles stacks into a standalone?
> >
> >   TTFN (ta-ta-for-now)
> >    Bridger
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Dan Shafer-2
Sarah.....

Right. A slight nit but worth noting. I suppose there are situations where
changing data on the fly and not saving it is useful. Can't think of one
off-hand except where I'd use a variable anyway, but....


On 5/1/06, Sarah Reichelt <[hidden email]> wrote:

>
> This is not quite true. Rev does permit modification of data in a
> standalone, but this new data will not be saved unless it is a
> separate file to the main program. This can be a sub-stack or any
> external data storage mechanism.
>
> In this case, the script change should happen, provided it fits within
> the scriptLimits, but the new script will not be saved if the stack
> being modified is part of the main application file.
>
> Cheers,
> Sarah
>
> On 5/2/06, Dan Shafer <[hidden email]> wrote:
> > Bridger....
> >
> > At leat part of the problem is that Revolution does not permit
> on-the-fly
> > modification of data of any kind in a stack (app) at runtime in the
> > standalone environment. You get around that particular limitation by
> storing
> > the changeable data in a sub-stack of your app's mainstack and setting
> up
> > standlone settings so that it creates that stack separately as well.
> Then
> > you may be able to tell a button in mainstack to set a script in a
> button of
> > a substack but I haven't tested that idea.
> >
> > On 5/1/06, Bridger Maxwell <[hidden email]> wrote:
> > >
> > > Hey,
> > >   In one of my programs I use the "Set the script of object to string"
> > > alot,
> > > but when I recently switched over to 2.7.1 Studio and started to make
> > > standalone programs, I noticed that this no longer works.  For my test
> I
> > > made a field and two buttons, one button set the script of the other
> > > button
> > > to the field.  I typed a simple on mouseUp handler that answers a
> message.
> > > It worked when I did it in the development environment, but not as a
> > > standalone.  Does this mean that I can't change script from the
> > > user-interface after it has been saved as a standalone?  Can someone
> give
> > > me
> > > the basic rundown of how Revolution compiles stacks into a standalone?
> > >
> > >   TTFN (ta-ta-for-now)
> > >    Bridger
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
>



--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dan Shafer, Information Product Consultant and Author
http://www.shafermedia.com
Get my book, "Revolution: Software at the Speed of Thought"
>From http://www.shafermediastore.com/tech_main.html
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Sarah Reichelt-2
Here's an example - I have an app that acts as a clock-timer. It never
needs to save any data except the position of the window, which it
saves to a preference file. However when it is running, it displays
different data every second. On startup, it gets the current time and
shows it and then updates the clock, timer & countdown as required.
When it quits, the data is gone.

Cheers,
Sarah the Nitpicker :-)

On 5/2/06, Dan Shafer <[hidden email]> wrote:

> Sarah.....
>
> Right. A slight nit but worth noting. I suppose there are situations where
> changing data on the fly and not saving it is useful. Can't think of one
> off-hand except where I'd use a variable anyway, but....
>
>
> On 5/1/06, Sarah Reichelt <[hidden email]> wrote:
> >
> > This is not quite true. Rev does permit modification of data in a
> > standalone, but this new data will not be saved unless it is a
> > separate file to the main program. This can be a sub-stack or any
> > external data storage mechanism.
> >
> > In this case, the script change should happen, provided it fits within
> > the scriptLimits, but the new script will not be saved if the stack
> > being modified is part of the main application file.
> >
> > Cheers,
> > Sarah
> >
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

viktoras d.
In reply to this post by Sarah Reichelt-2
 
Hi,
 
does this mean that it is not possible to create a standalone with a data
driven menu ? Like creating a menu from tab delimited file with item names
and links to external files that are being constantly updated... Is there
any workaround like using htmlText property with hyperlinks within text
field, etc..?
 
Best wishes
Viktoras
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

relative paths

viktoras d.
One more question...
 
How to force the stack to be run from its current directory when it is
opened from within Revolution Studio ? The problem I am experiencing is
setting relative paths for external files to open. It works fine when the
stack is packaged into standalone and executed. But when it is under
development it can not find files that are stored in its neighborhood i.e.
URL "file:test.txt" does not work... How to deal with this?
 
Thanks and bet wishes
Viktoras
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Martin Baxter-3
In reply to this post by viktoras d.
Viktoras Didziulis wrote:

>  
> Hi,
>  
> does this mean that it is not possible to create a standalone with a data
> driven menu ? Like creating a menu from tab delimited file with item names
> and links to external files that are being constantly updated... Is there
> any workaround like using htmlText property with hyperlinks within text
> field, etc..?
>  
> Best wishes
> Viktoras

Hi Viktoras,

If I understand you right, then I would say that there is no problem,
you just need to approach the design in the right way. In the
application I maintain, most of the menus are constructed at startup
from external configuration files, or by testing the contents of its
plugins folder etc..

Since a menu is really a button, you can change its contents (i.e. the
menu items) as you like. Of course its script must know what to do with
the menu items when they are chosen. I deal with this by writing the
scripts so they refer to external data (which can be updated of course)
in order to find out what to do.

For instance, in the case of my plugins menu, I read the contents of the
plugins folder at startup, turn the stack names into a menu, and store
the filenames of the stacks in a custom property. The menu script opens
a plugin stack by looking up the filename associated with the selected
menu item. The script is therefore generalised and doesn't need to
change, since it is the data that tells it what to do exactly.

Hope this helped...

Martin Baxter

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: relative paths

xtalkprogrammer
In reply to this post by viktoras d.
Hi Viktoras,

You could set the defaultfolder to the path to your stack.

put the defaultFolder into myFldr
set the itemDel to "/"
set the defaultFolder to ¬
   item 1 to -2 of the effective filename of me
put myData into url "file:/my file.txt"
put myMoreData into url "file:/folder/file.txt"
set the defaultFolder to myFldr

Best,

Mark

--

Economy-x-Talk
Consultancy and Software Engineering
http://economy-x-talk.com
http://www.salery.biz

Salery is the easiest way to get your own web store on-line: http://
www.salery.biz/salery.html



Op 2-mei-2006, om 10:56 heeft Viktoras Didziulis het volgende  
geschreven:

> One more question...
>
> How to force the stack to be run from its current directory when it is
> opened from within Revolution Studio ? The problem I am  
> experiencing is
> setting relative paths for external files to open. It works fine  
> when the
> stack is packaged into standalone and executed. But when it is under
> development it can not find files that are stored in its  
> neighborhood i.e.
> URL "file:test.txt" does not work... How to deal with this?
>
> Thanks and bet wishes
> Viktoras


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Kind regards,

Drs. Mark Schonewille

Economy-x-Talk Consultancy and Software Engineering
Homepage: http://economy-x-talk.com
Twitter: http://twitter.com/xtalkprogrammer
Facebook: http://facebook.com/LiveCode.Beginner
KvK: 50277553
Reply | Threaded
Open this post in threaded view
|

Re: relative paths

Peter T. Evensen
In reply to this post by viktoras d.
When I open a project, I usually manually set the defaultfolder to what I
want it to be for my project in the messagebox:  set the defaultfolder to
"/Projects/Whatever"

At 03:56 AM 5/2/2006, you wrote:

>One more question...
>
>How to force the stack to be run from its current directory when it is
>opened from within Revolution Studio ? The problem I am experiencing is
>setting relative paths for external files to open. It works fine when the
>stack is packaged into standalone and executed. But when it is under
>development it can not find files that are stored in its neighborhood i.e.
>URL "file:test.txt" does not work... How to deal with this?
>
>Thanks and bet wishes
>Viktoras
>_______________________________________________
>use-revolution mailing list
>[hidden email]
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-revolution

Peter T. Evensen
http://www.PetersRoadToHealth.com
314-629-5248 or 888-628-4588


_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: Changing Script In Standalone

Chipp Walters
In reply to this post by Bridger Maxwell
Bridger,

What you did should work with the following caveats.

As Stephen said, the number of lines in your field cannot be more than
10. You may only use 'set the script of' controls with scripts of ten
lines or less (not including the handler part if I remember correctly.)

So, creating dynamic scripting in a standalone is very difficult, if not
impossible. I believe there was a free version with these same script
limits which was the original purpose for setting the limits. Of course
it also prevents others from creating a competing authoring environment.

Also, the changes to the button script will not be saved.

Bridger Maxwell wrote:

> Hey,
>  In one of my programs I use the "Set the script of object to string" alot,
> but when I recently switched over to 2.7.1 Studio and started to make
> standalone programs, I noticed that this no longer works.  For my test I
> made a field and two buttons, one button set the script of the other button
> to the field.  I typed a simple on mouseUp handler that answers a message.
> It worked when I did it in the development environment, but not as a
> standalone.  Does this mean that I can't change script from the
> user-interface after it has been saved as a standalone?  Can someone
> give me
> the basic rundown of how Revolution compiles stacks into a standalone?

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

splash screen before application loads

viktoras d.
In reply to this post by Peter T. Evensen
 
As always thanks for all your help in advance :-)
 
It takes time (~5 sec) while my application loads on some computers, so
sometime it looks like it doesn't start at all. Usually end-users have a
limited patience so they try clicking and may even get angry... In order to
save their nerves is there a way to show a splash screen at most within one
second interval after they click the application icon and keep it there
until the main stack completely loads ? Are there any preferred ways on
designing a proper splash screen in Rev Studio. Actually it is just a small
image and a little text to display, but what is the optimal way to do this?
 
Best wishes
Viktoras
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before application loads

Phil Davis
Hi Viktoras,

One common way to handle this is to organize your app like this:

- the main app consists of the engine & your splash screen stack only.
This keeps the executable small so it opens quickly when the user starts
the app.

- the splash screen stack contains code that opens the 'real' main part
of your app after the splash screen is visible.

In this way of organizing your app's structure, the main part of your
app is a separate stackfile from the engine part (the .exe or .app on
Mac), but that doesn't cause any problems for execution. Many people on
this list recommend it (myself included).

Phil Davis


Viktoras Didziulis wrote:

>  
> As always thanks for all your help in advance :-)
>  
> It takes time (~5 sec) while my application loads on some computers, so
> sometime it looks like it doesn't start at all. Usually end-users have a
> limited patience so they try clicking and may even get angry... In order to
> save their nerves is there a way to show a splash screen at most within one
> second interval after they click the application icon and keep it there
> until the main stack completely loads ? Are there any preferred ways on
> designing a proper splash screen in Rev Studio. Actually it is just a small
> image and a little text to display, but what is the optimal way to do this?
>  
> Best wishes
> Viktoras
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before app loads -- sample script?

Erik Hansen

--- Phil Davis <[hidden email]> wrote:

> One common way to handle this is to organize
> your app like this:
>
> - the main app consists of the engine & your
> splash screen stack only.
> This keeps the executable small so it opens
> quickly when the user starts
> the app.
>
> - the splash screen stack contains code that
> opens the 'real' main part
> of your app after the splash screen is visible.
>
> In this way of organizing your app's structure,
> the main part of your
> app is a separate stackfile from the engine
> part (the .exe or .app on
> Mac), but that doesn't cause any problems for
> execution. Many people on
> this list recommend it (myself included).

this has been covered many times but so far
not with actual code. could anyone give
a coded example? my apps all have volatile
cards & groups - they may me cut - so putting
"on startup" in a card or group script is
not a possibility. wait... maybe a group
dedicated to "on startup" that is never
deleted...

anyway, i never quite understood where the
splash stack went after splashing.
maybe some real code would make the general
statements clear.

thanks,

Erik Hansen

[hidden email]    http://www.erikhansen.org

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com 
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before app loads -- sample script?

masmit
A very simple example would be where you have your mainstack (called  
"splashStack") as a splash screen, and your actual logic in a  
substack (called "logicStack").

In the script of stack "splashStack"

on startUp
   show me
   open stack "logicStack"
end startUp


in the script of stack "logicStack"

on openStack
   doAllYourInitializing
   hide stack "splashStack"
end openStack


Best,

Mark

On 3 May 2006, at 00:38, Erik Hansen wrote:

>
> --- Phil Davis <[hidden email]> wrote:
>
>> One common way to handle this is to organize
>> your app like this:
>>
>> - the main app consists of the engine & your
>> splash screen stack only.
>> This keeps the executable small so it opens
>> quickly when the user starts
>> the app.
>>
>> - the splash screen stack contains code that
>> opens the 'real' main part
>> of your app after the splash screen is visible.
>>
>> In this way of organizing your app's structure,
>> the main part of your
>> app is a separate stackfile from the engine
>> part (the .exe or .app on
>> Mac), but that doesn't cause any problems for
>> execution. Many people on
>> this list recommend it (myself included).
>
> this has been covered many times but so far
> not with actual code. could anyone give
> a coded example? my apps all have volatile
> cards & groups - they may me cut - so putting
> "on startup" in a card or group script is
> not a possibility. wait... maybe a group
> dedicated to "on startup" that is never
> deleted...
>
> anyway, i never quite understood where the
> splash stack went after splashing.
> maybe some real code would make the general
> statements clear.
>
> thanks,
>
> Erik Hansen
>
> [hidden email]    http://www.erikhansen.org
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
> _______________________________________________
> use-revolution mailing list
> [hidden email]
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before app loads -- sample script?

Richard Gaskin
In reply to this post by Erik Hansen
Mark Smith wrote:

> A very simple example would be where you have your mainstack (called  
> "splashStack") as a splash screen, and your actual logic in a  
> substack (called "logicStack").
>
> In the script of stack "splashStack"
>
> on startUp
>    show me
>    open stack "logicStack"
> end startUp
>
>
> in the script of stack "logicStack"
>
> on openStack
>    doAllYourInitializing
>    hide stack "splashStack"
> end openStack

If the goal is to have something savable, rather than a substack he'll
probably want a separate stack file:


   on startUp
     show me
     open stack "logicstack.rev"
   end startup


--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before app loads -- sample script?

Tereza Snyder

On May 2, 2006, at 7:54 PM, Richard Gaskin wrote:

> Mark Smith wrote:
>> A very simple example would be where you have your mainstack  
>> (called  "splashStack") as a splash screen, and your actual logic  
>> in a  substack (called "logicStack").
>> In the script of stack "splashStack"
>> on startUp
>>    show me
>>    open stack "logicStack"
>> end startUp
>> in the script of stack "logicStack"
>> on openStack
>>    doAllYourInitializing
>>    hide stack "splashStack"
>> end openStack
>
> If the goal is to have something savable, rather than a substack  
> he'll probably want a separate stack file:
>
>
>   on startUp
>     show me
>     open stack "logicstack.rev"
>   end startup
>

Also, give some thought to one central characteristic of standalone  
stacks: their stack script acts like a library script for all stacks.  
Stow your commonly-used utilities in that stack script, like say,  
error handling and quit routines that you use in every app you make.  
You might also attach, as substacks, your custom dialog stacks that  
you use without change in all your apps (e.g. error display, user  
registration, about screen, or custom ask and answer dialogs). On  
card 2 of the Splash stack, which will never be seen, plop your  
default menubar group, and any images you always need for cursors,  
logos etc.

Put the startup code in the CARD script of the splash stack, where it  
will be executed only once, on startup. Among its tasks might be  
'looking around' in defined directories for the "logic stack", or  
main stack of your application, and for other stacks like help stacks  
or preference stacks or library stacks. If you always name these  
stack files the same way, and always stow them in a predictable  
location, you can set up the stackfiles property of the splash stack  
to point to them; and your scripts will be able to find the  
application stacks with a simple reference, without needing to know  
their filenames.

You can initialize your essential globals, set the default directory,  
set up Revolution characteristics... whatever.

The openstack script in card 1 of the Splash stack might send a "open  
stack tMainstack in XXX seconds" and "hide stack tSplash in YYY  
seconds" message to itself. This would make the slash stack entirely  
self-contained. Once you have it working, you can reuse it without  
editing it at all. Just install new main stacks, preference stacks,  
help stacks, etc., double-click and go!


I follow this method, and if I weren't always thinking of  
improvements, I would never have to build a standalone again. I store  
all my application stacks in a subdirectory in a "resources" folder.  
This resources folder is the same one I use in the application bundle  
on macOS X, and that I park next to the .exe on windows. The startup  
script looks either next to itself for "resources" or next to the  
directory that contains itself (as it would in a bundle). The splash  
has my company logo, and stays on the screen only a few seconds.

t

_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
Reply | Threaded
Open this post in threaded view
|

Re: splash screen before app loads -- sample script?

Phil Davis
In reply to this post by Erik Hansen
Hi Eric,

Here's a quick example you can play with and modify as you like. It
isn't meant to be the be-all-end-all, it just illustrates the one app
structure idea I was promoting.

    http://pdslabs.net/stacks/sampleApp.zip

Just unzip, double-click 'appSplash.rev' and away you go.

Phil



Erik Hansen wrote:

> --- Phil Davis <[hidden email]> wrote:
>
>
>>One common way to handle this is to organize
>>your app like this:
>>
>>- the main app consists of the engine & your
>>splash screen stack only.
>>This keeps the executable small so it opens
>>quickly when the user starts
>>the app.
>>
>>- the splash screen stack contains code that
>>opens the 'real' main part
>>of your app after the splash screen is visible.
>>
>>In this way of organizing your app's structure,
>>the main part of your
>>app is a separate stackfile from the engine
>>part (the .exe or .app on
>>Mac), but that doesn't cause any problems for
>>execution. Many people on
>>this list recommend it (myself included).
>
>
> this has been covered many times but so far
> not with actual code. could anyone give
> a coded example? my apps all have volatile
> cards & groups - they may me cut - so putting
> "on startup" in a card or group script is
> not a possibility. wait... maybe a group
> dedicated to "on startup" that is never
> deleted...
>
> anyway, i never quite understood where the
> splash stack went after splashing.
> maybe some real code would make the general
> statements clear.
>
> thanks,
>
> Erik Hansen
>
> [hidden email]    http://www.erikhansen.org
_______________________________________________
use-revolution mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution
12