2014-12-24 07:38:16 +00:00
|
|
|
; open a viewport, print coordinates of mouse clicks
|
|
|
|
; currently need to ctrl-c to exit after closing the viewport
|
|
|
|
(function main [
|
2015-01-12 18:45:08 +00:00
|
|
|
(window-on (("practice" literal)) 300:literal 300:literal)
|
2014-12-24 07:38:16 +00:00
|
|
|
{ begin
|
|
|
|
(pos:integer-integer-pair click?:boolean <- mouse-position)
|
2015-01-05 09:21:39 +00:00
|
|
|
(loop-unless click?:boolean)
|
2014-12-24 07:38:16 +00:00
|
|
|
(x:integer <- get pos:integer-integer-pair 0:offset)
|
|
|
|
(y:integer <- get pos:integer-integer-pair 1:offset)
|
2015-01-18 01:00:44 +00:00
|
|
|
;? (print-primitive-to-host (("AAA " literal)))
|
|
|
|
;? (print-primitive-to-host x:integer)
|
|
|
|
;? (print-primitive-to-host ((", " literal)))
|
|
|
|
;? (print-primitive-to-host y:integer)
|
|
|
|
;? (print-primitive-to-host (("\n" literal)))
|
|
|
|
(print-integer nil:literal/terminal x:integer)
|
2015-01-17 00:35:08 +00:00
|
|
|
(print-primitive-to-host ((", " literal)))
|
2015-01-18 01:00:44 +00:00
|
|
|
(print-integer nil:literal/terminal y:integer)
|
2015-01-17 00:35:08 +00:00
|
|
|
(print-primitive-to-host (("\n" literal)))
|
2014-12-24 07:38:16 +00:00
|
|
|
(loop)
|
|
|
|
}
|
2015-01-12 18:45:08 +00:00
|
|
|
(window-off)
|
2014-12-24 07:38:16 +00:00
|
|
|
])
|