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 843K 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   

Travelled to 5 computer(s): bhatertpkbcr, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz, 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: 34 / 76
Version history: 4 change(s)
Referenced in: #1027031

Formerly at http://tinybrain.de/1027029 & http://1027029.tinybrain.de