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

35
LINES

< > BotCompany Repo | #1027029 // Lock Screen with CPU meter

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Uses 911K of libraries. Click here for Pure Java version (7212L/37K).

!7

cmodule LockScreenWithCPU > DynSingleFunction {
  switchable bool withConfirm; // to filter out accidental clicks
  transient JFrame frame;
  transient JLabel label;
  
  start {
    dm_require("#1026796/CombinedCPUTrayIcon");
    dm_vmBus_onMessage_q newCombinedCPUTrayImage(voidfunc(O mod, BufferedImage image) {
      setImage(label, image);
    });
  }
  
  void doIt { showFullscreen(); }
  
  void showFullscreen enter {
    if (frame != null) activateFrame(frame);
    label = jcenteredlabel("Lock mode!");
    frame = showFullScreen(jfullcenter(
      centerAndSouthWithMargins(
        label,
        jMarginButton(20, "Exit", rThread exitStep2))));
    onFrameClose(frame, r { frame = null; });
  }
  
  void exitFullscreen enter {
    disposeFrame(frame);
  }
  
  void exitStep2 enter {
    /*if (!withConfirm) TODO */
    exitFullscreen();
  }
}

Author comment

Began life as a copy of #1027028

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1027029
Snippet name: Lock Screen with CPU meter
Eternal ID of this version: #1027029/5
Text MD5: 13826813a2847f06e90aaf44d07f4873
Transpilation MD5: 9ceb2b189ed42dfadcae84848d2bd4c9
Author: stefan
Category: javax / gui
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-11 18:28:22
Source code size: 896 bytes / 35 lines
Pitched / IR pitched: No / No
Views / Downloads: 201 / 305
Version history: 4 change(s)
Referenced in: #1027031 - Lock Screen with CPU meter [shortened]