Advertisement
Guest User

Untitled

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