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

11
LINES

< > BotCompany Repo | #1035998 // looselyBindLiveValueToSlider - only grab once upon display, but save on every user interaction

JavaX fragment (include) [tags: use-pretranspiled]

Libraryless. Click here for Pure Java version (9771L/54K).

static JSlider looselyBindLiveValueToSlider(IVarWithNotify<Int> lv, JSlider slider) {
  onChange(slider, -> lv.set(intFromSlider(slider)));
  bindToComponent(slider, -> {
    Int value = lv!;
    if (value != null)
      setSliderValue(slider, value);
    else
      lv.set(intFromSlider(slider));
  });
  ret slider;
}

Author comment

Began life as a copy of #1035882

download  show line numbers  debug dex  old transpilations   

Travelled to 3 computer(s): elmgxqgtpvxh, mqqgnosmbjvj, wnsclhtenguj

No comments. add comment

Snippet ID: #1035998
Snippet name: looselyBindLiveValueToSlider - only grab once upon display, but save on every user interaction
Eternal ID of this version: #1035998/4
Text MD5: 71613d8600a91a6e0cfdb22bb5fe96f5
Transpilation MD5: f4d595e1f9dd8112d2e27438852ab1f7
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-08-21 08:29:35
Source code size: 329 bytes / 11 lines
Pitched / IR pitched: No / No
Views / Downloads: 139 / 201
Version history: 3 change(s)
Referenced in: [show references]