Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

12
LINES

< > BotCompany Repo | #1022973 // onClipboardFile_monitorRegularly

JavaX fragment (include)

static AutoCloseable onClipboardFile_monitorRegularly(double seconds, final VF1<File> f) {
  new Var<File> last;
  
  ret combineAutoCloseables(onClipboardFile(voidfunc(File file) {
    last.set(file);
    callF(f, file);
  }), timerAsAutoCloseable(doEvery(seconds, r {
      File file = fileFromClipboard();
      if (file != null && setVar_trueIfChanged(last, file))
        callF(f, file);
    })));
}

Author comment

Began life as a copy of #1022922

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022973
Snippet name: onClipboardFile_monitorRegularly
Eternal ID of this version: #1022973/1
Text MD5: 316fcd237b9c8e788e2ac530a1e7dda1
Author: stefan
Category: javax / clipboard
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-17 06:31:30
Source code size: 415 bytes / 12 lines
Pitched / IR pitched: No / No
Views / Downloads: 267 / 305
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)