Handbook
Glossary
mouse-location ( view event -- loc )
Cocoa bridge
ยป
Cocoa view utilities
Prev:
view-dim ( view -- dim )
Vocabulary
cocoa
.
views
Inputs
view
an
NSView
event
an
NSEvent
Outputs
loc
a pair of real numbers
Word description
Outputs the current mouse location.
Definition
USING:
accessors
arrays
cocoa.messages
cocoa.runtime
cocoa.types
core-graphics.types
kernel
math
;
IN:
cocoa.views
:
mouse-location
( view event -- loc )
[
{
NSPoint
{
id
SEL
}
}
"locationInWindow"
send
f
{
NSPoint
{
id
SEL
NSPoint
id
}
}
"convertPoint:fromView:"
send
[
x>>
]
[
y>>
]
bi
]
[
drop
{
NSRect
{
id
SEL
}
}
"frame"
send
CGRect-h
]
2bi
swap
-
[
>integer
]
bi@
2array
;