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

13
LINES

< > BotCompany Repo | #1015826 // listPopupMenuItemsThreaded - adds to the menu if it already exists, runs actions in new thread with messagebox on error

JavaX fragment (include)

// action: voidfunc(S item)
static JList listPopupMenuItemsThreaded(final JList list, O... params) {
  for (int i = 0; i+1 < l(params); i += 2) {
    if (isMenuSeparatorIndicator(params[i])) continue with --i;
    fO action = params[i+1];
    listPopupMenuItem(list, str(params[i]), voidfunc(fS item) {
      thread-messagebox {
        callF(action, item);
      }
    });
  }
  ret list;
}

Author comment

Began life as a copy of #1009959

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: #1015826
Snippet name: listPopupMenuItemsThreaded - adds to the menu if it already exists, runs actions in new thread with messagebox on error
Eternal ID of this version: #1015826/7
Text MD5: de3cf2a293bdb4dd1e8b24213d4b6d85
Author: stefan
Category: javax / gui
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-12-08 16:58:51
Source code size: 403 bytes / 13 lines
Pitched / IR pitched: No / No
Views / Downloads: 376 / 407
Version history: 6 change(s)
Referenced in: [show references]