// f: voidfunc(float) static JSlider liveSliderZeroToOne(final float def, fO f) { ret swing(func -> JSlider { final int max = 9999; final JSlider slider = new JSlider(0, max, iround(def*max)); slider.addChangeListener(new ChangeListener { int lastValue = slider.getValue(); public void stateChanged(ChangeEvent e) { int value = slider.getValue(); if (value != lastValue) { lastValue = value; float x = value/(float) max; setToolTip(slider, str(x)); pcallF(f, x); } } }); ret slider; }); }
download show line numbers debug dex old transpilations
Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, ddnzoavkxhuk, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment