// f returns true on ok (only then form is hidden) static F0<Bool> disableButtonWhileCalcing(final F0<Bool> f) { ret func -> bool { final JButton button = heldInstance(JButton); disableButton(button); thread { temp holdInstance(button); try { bool ok = isTrue(callF(f)); if (ok) disposeWindow(button); } finally { enableButton(button); } } false; }; }
download show line numbers debug dex old transpilations
Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1015736 |
Snippet name: | disableButtonWhileCalcing - for form button actions (with window dispose) |
Eternal ID of this version: | #1015736/5 |
Text MD5: | 1f159aa63d6e40ebfab95c34ef1692be |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2018-06-18 13:11:09 |
Source code size: | 439 bytes / 17 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 427 / 482 |
Version history: | 4 change(s) |
Referenced in: | #1006654 - Standard functions list 2 (LIVE, continuation of #761) #1015872 - disableButtonWhileCalcing2 - for button actions #1016417 - disableButtonWhileCalcing3 - for button actions, same as 2, but enclosed as runnable |