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

21
LINES

< > BotCompany Repo | #1020096 // Automatically Reload Focused Module [When Reloadable]

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

Libraryless. Click here for Pure Java version (15233L/105K).

1  
!7
2  
3  
// TODO: doesn't always work
4  
5  
module AutoReloadFocusedModule > DynPrintLogAndEnabled {
6  
  bool verbose;
7  
8  
  S switchableFields() { ret 'verbose; }
9  
  
10  
  start {
11  
    doEvery(1.0, r {
12  
      O mod = dm_activeModule();
13  
      Container frame = dm_frame(mod);
14  
      if (verbose) print("Got frame for module " + dm_moduleName(mod) + ": " + (frame != null));
15  
      if (containsChildWithShortName(frame, 'dm_ReloadButton)) {
16  
        print("Auto-reloading " + dm_moduleName(mod));
17  
        dm_reloadModule(mod);
18  
      }
19  
    });
20  
  }
21  
}

download  show line numbers  debug dex  old transpilations   

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

No comments. add comment

Snippet ID: #1020096
Snippet name: Automatically Reload Focused Module [When Reloadable]
Eternal ID of this version: #1020096/10
Text MD5: 14aa2d0735fb860dcb2201657cbcc69e
Transpilation MD5: b379ab1f043e56ee5d4311d5f0b1d649
Author: stefan
Category: javax / a.i.
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-27 02:07:59
Source code size: 543 bytes / 21 lines
Pitched / IR pitched: No / No
Views / Downloads: 310 / 21136
Version history: 9 change(s)
Referenced in: [show references]