Libraryless. Click here for Pure Java version (9771L/54K).
1 | static JSlider looselyBindLiveValueToSlider(IVarWithNotify<Int> lv, JSlider slider) {
|
2 | onChange(slider, -> lv.set(intFromSlider(slider))); |
3 | bindToComponent(slider, -> {
|
4 | Int value = lv!; |
5 | if (value != null) |
6 | setSliderValue(slider, value); |
7 | else |
8 | lv.set(intFromSlider(slider)); |
9 | }); |
10 | ret slider; |
11 | } |
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: | 389 / 489 |
| Version history: | 3 change(s) |
| Referenced in: | [show references] |