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 824K of libraries. Click here for Pure Java version (8321L/43K).

!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   

Travelled to 12 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pzhvpgtvlbxg, tvejysmllsmz, 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: 5d10f4176769183c98997feb16f97f15
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: 291 / 4393
Version history: 33 change(s)
Referenced in: [show references]

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