Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] double-click check function

From: peoyli::algonet::se at: 14-Apr-2001 13:46

Hi, Noticed that there were no such thing yet so... Almost lile AmigaOS/Intuition function DoubleClick() /PeO [ REBOL [] double-click?: func [ starttime [time!] {The timestamp value describing the start of the double-click period you are considering} currenttime [time!] {The timestamp value describing the end of the double-click time period you are considering} timeout [time!] {The double-click timeout value} ][ if currenttime - starttime <= timeout [ return true ] return false ] ;------------------------- Example ---------------------------------- ; Maybe there is an easier way to use the function ? ; ; The first either.. is to not count double-clicks between different ; lines in the list (clicking for example "a" and "b" within the ; specified timeout value). The second does the actual double-click ; check. time1: 0:0:0 val1: "" view layout/offset [ l: text-list 100x200 data ["a" "b" "c"] [ time2: now/time/precise val2: to-string l/picked either val1 = val2 [ either double-click? time1 time2 0:0:0.5 [ ; time within double-click print [l/picked "double-clicked"] ][ time1: time2 ] ][ val1: val2 time1: time2 ] ] ] 700x800 ]