Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'Win32API'
- getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
- lpPoint = " " * 8 # store two LONGs
- getCursorPos.Call(lpPoint)
- @x,@y = lpPoint.unpack("LL") # get the actual values
- puts "x:", @x, " y:", @y
- Shoes.app :height => 500, :width => 500 do
- stack do
- require 'Win32API'
- getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
- lpPoint = " " * 8 # store two LONGs
- getCursorPos.Call(lpPoint)
- @x,@y = lpPoint.unpack("LL") # get the actual values
- puts "x:", @x, " y:", @y
- @label = para "Esto es un label"
- @button = button("Presioname")
- keypress do |k|
- @label.text = "x:", @x ," y:",@y
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement