How to tell when IDE is done loading
J. Landman Gay
jacque at hyperactivesw.com
Sat Dec 27 11:29:05 EST 2014
I'm confused. LiveCode knows how to open a stack as part of its startup routine. Since card 1 is always opened first, a preopenstack handler there will always fire and you can do your setup there from that card without worrying about timing.
On December 27, 2014 10:12:19 AM CST, Michael Doub <mikedoub at gmail.com> wrote:
>Jacqueline and Mike, thanks for you help with this.
>
>Just to clarify, I am trying to solve the problem in the environment
>where livecode is not running and the user double clicks on the
>MasterLibrary stack. This is not a standalone program but a stack
>that
>is being started from the desktop. I am testing on a Mac, but I need
>to
>test on a PC to see if the behavior is any different.
>
>Mike, I think you gave me a great clue. The current logic in the
>MasterLibrary is one where the preopenstack handler puts up a splash
>screen and sends off a wakeup message to come back in 5 seconds. I was
>
>quite surprised to see how long it actually took the IDE to get
>initialized. This is way too long to wait if livecode is already up
>and
>running.
>
>I added some debug code to display the allowinterupt state and found
>that at the time my preopenstack handler messages gets called
>allowinterupts is false, but in my wakeup hander the allowinterupts is
>true. This leads me to believe that I can monitor the allowinterupts
>at
>a faster frequency and do the actual wake up processing when I see it
>go
>true.
>
>Regards,
> Mike
>
>
>On 12/26/14 4:38 PM, Mike Bonner wrote:
>> It looks like the IDE load order is this:
>> System params are checked
>> libraries loaded
>> globals set
>> preferences set
>> icons loaded
>> patterns loaded
>> script editor loaded
>> user icon libraries loaded
>> error management loaded
>> tools loaded
>> menu bar loaded
>> app overview loaded
>> message box loaded
>> debugger loaded
>> quicktime loaded
>> plugins loaded
>> then "revInternail_InitializeFinalSteps..
>> after that, there are still a couple things such as checking the
>license
>> being used (community etc) and setting some os specific parameters.
>The
>> very last thing (it seems) is the line "set the allowinterrupts to
>true"
>>
>> You can see this info in the script of stack home.rev, handler
>> revInternal_openStack. Wonder if there is something in that script
>you can
>> check to determine if the IDE is far enough along to do the things
>you
>> need.
>>
>>
>> On Fri, Dec 26, 2014 at 1:31 PM, J. Landman Gay
><jacque at hyperactivesw.com>
>> wrote:
>>
>>> On 12/24/2014 11:57 AM, Michael Doub wrote:
>>>
>>>> I have tried that but I need to process the resumeStack message
>which
>>>> seems to get called as part of the startup process.
>>>>
>>> Resumestack shouldn't be sent normally when a stack opens. There's a
>>> difference between starting up a standalone and starting the IDE
>though; it
>>> may be that some of the IDE stacks need to deal with resumestack.
>But your
>>> own stack shouldn't need to.
>>>
>>> I guess I have to
>>>> manually set a global flag and have the timed handler unblock the
>>>> flag. What is the very first handler that an application can
>process?
>>>> Startup?
>>>>
>>> Again, it depends. In a standalone the first message is startup. The
>stack
>>> isn't fully loaded at that point so you can't manipulate stack or
>card
>>> objects yet but you can set global properties there.
>>>
>>> But in the IDE, LiveCode itself catches the startup message and your
>stack
>>> will never receive it. The first message your stack will get is
>>> preOpenStack.
>>>
>>>
>>> Is there an ordered list of messages that are fired for startup
>and
>>>> opening a stack? Opening a card would be useful too. I can't say
>that
>>>> I have ever seen this anywhere in the documentation.
>>>>
>>> It follows the normal message path in reverse, starting with the
>stack
>>> messages followed by background group messages and then card
>messages. If
>>> there are card groups on the first card, they get sent last.
>>>
>>> --
>>> Jacqueline Landman Gay | jacque at hyperactivesw.com
>>> HyperActive Software | http://www.hyperactivesw.com
>>>
>>> _______________________________________________
>>> use-livecode mailing list
>>> use-livecode at lists.runrev.com
>>> Please visit this url to subscribe, unsubscribe and manage your
>>> subscription preferences:
>>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>>
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>_______________________________________________
>use-livecode mailing list
>use-livecode at lists.runrev.com
>Please visit this url to subscribe, unsubscribe and manage your
>subscription preferences:
>http://lists.runrev.com/mailman/listinfo/use-livecode
--
Jacqueline Landman Gay | jacque at hyperactivesw.com
HyperActive Software | http://www.hyperactivesw.com
More information about the use-livecode
mailing list