Revision: 4229 http://vexi.svn.sourceforge.net/vexi/?rev=4229&view=rev Author: clrg Date: 2011-09-15 23:41:10 +0000 (Thu, 15 Sep 2011) Log Message: ----------- Fix repeatable bug causing repeating widgets to not respond consistently to rapid clicking
Modified Paths: -------------- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/repeatable.t Modified: trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/repeatable.t =================================================================== --- trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/repeatable.t 2011-09-15 17:59:39 UTC (rev 4228) +++ trunk/org.vexi-vexi.widgets/src_main/org/vexi/lib/role/repeatable.t 2011-09-15 23:41:10 UTC (rev 4229) @@ -33,18 +33,26 @@ /** initiate (true) or stop (false) repeating action */ static.repeatWrite = function(v) { if (v) { - // only start if previously false and thread is inactive - if (!trapee.repeat and !trapee.v_repeat_thread) { - // marks the thread as active - trapee.v_repeat_thread = true; - vexi.thread = function() { - while (trapee.repeat) { - trapee.action = true; - trapee.counter ++; + if (!trapee.repeat) { + // perform first action immediately + trapee.action = true; + // only start if previously false and thread is inactive + if (!trapee.v_repeat_thread) { + // marks the thread as active + trapee.v_repeat_thread = true; + // begin background thread + vexi.thread = function() { + // pause before first repeating action vexi.thread.sleep(trapee.interval); + while (trapee.repeat) { + trapee.action = true; + trapee.counter ++; + // pause for set interval before repeat + vexi.thread.sleep(trapee.interval); + } + // mark thread inactive + trapee.v_repeat_thread = false; } - // mark thread inactive - trapee.v_repeat_thread = false; } } } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. ------------------------------------------------------------------------------ BlackBerry® DevCon Americas, Oct. 18-20, San Francisco, CA http://p.sf.net/sfu/rim-devcon-copy2 _______________________________________________ Vexi-svn mailing list Vexi-svn@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/vexi-svn