Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
27
Task/Mouse-position/Nim/mouse-position.nim
Normal file
27
Task/Mouse-position/Nim/mouse-position.nim
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import gintro/[glib, gobject, gtk, gio]
|
||||
import gintro/gdk except Window
|
||||
|
||||
#---------------------------------------------------------------------------------------------------
|
||||
|
||||
proc onButtonPress(window: ApplicationWindow; event: Event; data: pointer): bool =
|
||||
echo event.getCoords()
|
||||
result = true
|
||||
|
||||
#---------------------------------------------------------------------------------------------------
|
||||
|
||||
proc activate(app: Application) =
|
||||
## Activate the application.
|
||||
|
||||
let window = app.newApplicationWindow()
|
||||
window.setTitle("Mouse position")
|
||||
window.setSizeRequest(640, 480)
|
||||
|
||||
discard window.connect("button-press-event", onButtonPress, pointer(nil))
|
||||
|
||||
window.showAll()
|
||||
|
||||
#———————————————————————————————————————————————————————————————————————————————————————————————————
|
||||
|
||||
let app = newApplication(Application, "Rosetta.MousePosition")
|
||||
discard app.connect("activate", activate)
|
||||
discard app.run()
|
||||
Loading…
Add table
Add a link
Reference in a new issue