Transpiled version (3600L) is out of date.
1 | static JSlider liveSlider(int min, int max, int value, IVF1<Int> onChange) { |
2 | ret swing(() -> { |
3 | JSlider slider = new JSlider(min, max, value); |
4 | slider.addChangeListener(new ChangeListener { |
5 | int lastValue = slider.getValue(); |
6 | public void stateChanged(ChangeEvent e) { |
7 | int value = slider.getValue(); |
8 | if (value != lastValue) { |
9 | lastValue = value; |
10 | setToolTip(slider, str(value)); |
11 | pcallF(onChange, value); |
12 | } |
13 | } |
14 | }); |
15 | ret slider; |
16 | }); |
17 | } |
Began life as a copy of #1005725
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx
No comments. add comment
Snippet ID: | #1031901 |
Snippet name: | liveSlider - also creates auto-tooltip (do we want that?) |
Eternal ID of this version: | #1031901/2 |
Text MD5: | 1d54cc6d99f8945aa09c758e055cd424 |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-07-25 11:47:25 |
Source code size: | 531 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 195 / 263 |
Version history: | 1 change(s) |
Referenced in: | [show references] |