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

39
LINES

< > BotCompany Repo | #1018870 // Auto-Google Image [Dyn Module]

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

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

!7

static BufferedImage googleImageSearch_new(S query) {
  ret googleImageSearch_new2(query);
}

cmodule AutoGoogleImage > DynImageSurface {
  S typingText;
  transient S text;
  bool listen;
  
  start {
    dm_onTopInput_q(voidfunc(S s) {
      if (listen) show(s)
    });
  }
  
  enhanceFrame { minFrameSize(f, 300, 300); }

  visualize {
    ret northCenterSouthWithMargins(dm_bigInputAndSubmit('typingText, "Visualize", rThread { show(typingText) }),
      super.visualize(),
      vstackWithSpacing(
        centeredLiveValueLabel(dm_fieldLiveValue('text)),
        dm_rightAlignedCheckBox('listen)));
  }
  
  // API
  
  void show(S query) q {
    pcall {
      setField(typingText := query);
      BufferedImage img = quickVisualize(query);
      if (img == null) ret;
      setImage(img);
      setField(text := query);
    }
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv

No comments. add comment

Snippet ID: #1018870
Snippet name: Auto-Google Image [Dyn Module]
Eternal ID of this version: #1018870/34
Text MD5: e12b4019e34f05022cff02a1ec218ae3
Transpilation MD5: 229500e38825bf4618bec0a10ff6c9de
Author: stefan
Category: javax / stefan's os
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2020-02-10 19:08:39
Source code size: 881 bytes / 39 lines
Pitched / IR pitched: No / No
Views / Downloads: 563 / 4735
Version history: 33 change(s)
Referenced in: [show references]