Libraryless. Click here for Pure Java version (25241L/160K).
1 | svoid imageSurfaceOnLeftMouseDown(ImageSurface is, IVF1<Pt> action) { |
2 | if (is == null || action == null) ret; |
3 | swing { |
4 | MouseAdapter ma = new MouseAdapter { |
5 | public void mousePressed(MouseEvent e) { |
6 | if (e.getButton() == 1) |
7 | pcallF(action, is.pointFromEvent(e)); |
8 | } |
9 | }; |
10 | is.addMouseListener(ma); |
11 | } |
12 | } |
Began life as a copy of #1024682
download show line numbers debug dex old transpilations
Travelled to 3 computer(s): bhatertpkbcr, mowyntqkapby, mqqgnosmbjvj
No comments. add comment
Snippet ID: | #1033920 |
Snippet name: | imageSurfaceOnLeftMouseDown |
Eternal ID of this version: | #1033920/3 |
Text MD5: | 790645cc8266c5a45efad62e3024fd0e |
Transpilation MD5: | eec8fdfaf47bc3fdc5c5439f9072ea6b |
Author: | stefan |
Category: | javax / gui |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2022-01-11 21:22:48 |
Source code size: | 349 bytes / 12 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 138 / 208 |
Version history: | 2 change(s) |
Referenced in: | [show references] |