Test if script is running ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Test if script is running ?

karl-8
I have a button thats starts a script and that script is 'ticking' for a
while and then pauses.
Is there a way to test if the script is running so multiple clicks on
the button does not restart the 'ticking' script ?
I tested to drop the script name tile in a tester but that was not possible.

Karl
_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Test if script is running ?

Scott Wallace
Hi, Karl,

No, I don't think there's any such feature directly accessible in the  
current tile system, though a good case could be made for adding one.

In the meantime, if you're willing to resort to textual code in a  
single script, you can use the expression:

   (self existingScriptInstantiationForSelector: #foo) status = #ticking

to determine whether an object's script named "foo" is currently  
ticking.

Cheers,

  -- Scott


On Oct 29, 2006, at 3:11 PM, karl wrote:

> I have a button thats starts a script and that script is 'ticking'  
> for a
> while and then pauses.
> Is there a way to test if the script is running so multiple clicks on
> the button does not restart the 'ticking' script ?
> I tested to drop the script name tile in a tester but that was not  
> possible.
>
> Karl
> _______________________________________________
> Squeakland mailing list
> [hidden email]
> http://squeakland.org/mailman/listinfo/squeakland

_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Test if script is running ?

Alan Kay
Both of you are right ... it would be a good addition to have an Etoy
test for the status of a script.

Cheers,

Alan

At 03:05 AM 10/30/2006, Scott Wallace wrote:

>Hi, Karl,
>
>No, I don't think there's any such feature directly accessible in the
>current tile system, though a good case could be made for adding one.
>
>In the meantime, if you're willing to resort to textual code in a
>single script, you can use the expression:
>
>    (self existingScriptInstantiationForSelector: #foo) status = #ticking
>
>to determine whether an object's script named "foo" is currently
>ticking.
>
>Cheers,
>
>   -- Scott
>
>
>On Oct 29, 2006, at 3:11 PM, karl wrote:
>
> > I have a button thats starts a script and that script is 'ticking'
> > for a
> > while and then pauses.
> > Is there a way to test if the script is running so multiple clicks on
> > the button does not restart the 'ticking' script ?
> > I tested to drop the script name tile in a tester but that was not
> > possible.
> >
> > Karl
> > _______________________________________________
> > Squeakland mailing list
> > [hidden email]
> > http://squeakland.org/mailman/listinfo/squeakland
>
>_______________________________________________
>Squeakland mailing list
>[hidden email]
>http://squeakland.org/mailman/listinfo/squeakland

_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland
Reply | Threaded
Open this post in threaded view
|

Re: Test if script is running ?

karl-8
Alan Kay skrev:
> Both of you are right ... it would be a good addition to have an Etoy
> test for the status of a script.
>
> Cheers,
>
> Alan
I took a look at the code but did not understand how to implement it.
Maybe someone with a better understanding of the eToys can do it.
Karl

>
> At 03:05 AM 10/30/2006, Scott Wallace wrote:
>> Hi, Karl,
>>
>> No, I don't think there's any such feature directly accessible in the
>> current tile system, though a good case could be made for adding one.
>>
>> In the meantime, if you're willing to resort to textual code in a
>> single script, you can use the expression:
>>
>>    (self existingScriptInstantiationForSelector: #foo) status = #ticking
>>
>> to determine whether an object's script named "foo" is currently
>> ticking.
>>
>> Cheers,
>>
>>   -- Scott
>>
>>
>> On Oct 29, 2006, at 3:11 PM, karl wrote:
>>
>> > I have a button thats starts a script and that script is 'ticking'
>> > for a
>> > while and then pauses.
>> > Is there a way to test if the script is running so multiple clicks on
>> > the button does not restart the 'ticking' script ?
>> > I tested to drop the script name tile in a tester but that was not
>> > possible.
>> >
>> > Karl
>> > _______________________________________________
>> > Squeakland mailing list
>> > [hidden email]
>> > http://squeakland.org/mailman/listinfo/squeakland
>>
>> _______________________________________________
>> Squeakland mailing list
>> [hidden email]
>> http://squeakland.org/mailman/listinfo/squeakland
>
>

_______________________________________________
Squeakland mailing list
[hidden email]
http://squeakland.org/mailman/listinfo/squeakland