Can a mouseclick simultaneously send a message as it ends a "repeat until the mouseclick" loop?
mdswindell at charter.net
Fri Nov 22 02:54:01 EST 2002
on 11/21/02 10:24 PM, Jan Schenkel at janschenkel at yahoo.com wrote:
> --- Mark Swindell <mdswindell at charter.net> wrote:
>> If I am in a (repeat until the mouseclick) loop, is
>> it possible to have the
>> same mouseclick that ends the repeat also send a
>> mouseUp event to another
>> button? I have a repeating slide show that I'd like
>> the user to be able to
>> change simply by clicking on a new button, not
>> clicking once to stop the
>> slideshow, and again to start the new one. Another
>> angle on accomplishing
> Hi Mark,
> Even though your 'repeat until the mouseClick' is
> considered a 'no-no' because it gobbles up all the CPU
> time, you should have a look at the 'mouseControl'
> definition in the Transcript documentation.
> Basically, it gives you the type and the number of the
> control the mouse pointer is currently hovering over.
> So your loop should end something like this:
> repeat until the mouseClick
> -- do your slideshow here
> end repeat
> get the mouseControl
> if it is not empty then send "mouseUp" to it
> Hope this helped,
> Jan Schenkel.
Thanks, Jan. When I checked out the mouseControl function it appears to
return the type and layer of the control. While I could send a mouseUp to
the control by testing for it being under the cursor, what I need it for the
mouseUp to be sent on actually clicking the mouse from within the repeat
loop, not simply crossing over, or hovering over, the control region. I'm
probably missing something, so please educate me.
Given that I have a pretty simple thing going on: On ShowWords... repeat
until the mouseclick... put word the random of gMyWords into fld myField...
other stuff... wait gtheTicks... end repeat... end mouseUp, how could I
better script the performance to be able to execute a new mouseUp without
having to waste one to exit the existing one without having to waste one?
More information about the Use-livecode