diff options
| author | Simon Krauter <trustablecode@gmail.com> | 2019-12-10 22:42:28 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-12-10 22:42:28 +0100 |
| commit | 84a2b5c326658460d213b540e4f122b422deb5d6 (patch) | |
| tree | c459765dbea1732a279f27dd1a9151e9023cfdf5 | |
| parent | 9c69e88cee6a857140d75494c22b623a80797b5f (diff) | |
| parent | 5e6b226c81beab2d352ecee0993c47dc7ec7488d (diff) | |
| download | NiGui-84a2b5c326658460d213b540e4f122b422deb5d6.tar.gz NiGui-84a2b5c326658460d213b540e4f122b422deb5d6.zip | |
Merge pull request #78 from mark-summerfield/patch-1
Added an onMouseButtonDown event handler in example_10_drawing
| -rwxr-xr-x | examples/example_10_drawing.nim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/example_10_drawing.nim b/examples/example_10_drawing.nim index 5fb8b55..9b342ba 100755 --- a/examples/example_10_drawing.nim +++ b/examples/example_10_drawing.nim @@ -64,5 +64,9 @@ control1.onDraw = proc (event: DrawEvent) = canvas.drawImage(image2, 120, 120, 50)
# Draws an image stretched
+control1.onMouseButtonDown = proc (event: MouseEvent) =
+ echo(event.button, " (", event.x, ", ", event.y, ")")
+ # Shows where the mouse is clicked in control-relative coordinates
+
window.show()
app.run()
|
