Advertisement
Guest User

Untitled

a guest
Apr 30th, 2012
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. require 'Win32API'
  2.  
  3. getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
  4. lpPoint = " " * 8 # store two LONGs
  5. getCursorPos.Call(lpPoint)
  6. @x,@y = lpPoint.unpack("LL") # get the actual values
  7. puts "x:", @x, " y:", @y
  8. Shoes.app :height => 500, :width => 500 do
  9. stack do
  10.  
  11. require 'Win32API'
  12.  
  13. getCursorPos = Win32API.new("user32", "GetCursorPos", ['P'], 'V')
  14. lpPoint = " " * 8 # store two LONGs
  15. getCursorPos.Call(lpPoint)
  16. @x,@y = lpPoint.unpack("LL") # get the actual values
  17. puts "x:", @x, " y:", @y
  18.  
  19.  
  20. @label = para "Esto es un label"
  21. @button = button("Presioname")
  22. keypress do |k|
  23. @label.text = "x:", @x ," y:",@y
  24. end
  25.  
  26. end
  27. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement