#!ruby -Ks
require 'phi'
form = Phi::Form.new

ptr = nil

button = Phi::Button.new form
button.on_click = proc{
  bitmap = Phi::Bitmap.new
  bitmap.load('C:\\Program Files\\Common Files\\Borland Shared\\Images\\Splash\\256color\\factory.bmp')
  bitmap.height.times{|y|
    ptr = bitmap.scan_line_direct(y)
    bitmap.width.times{|x|
      ptr[x] = y
    }
  }
  form.canvas.draw(0,0,bitmap)
}

btn = Phi::Button.new form, :btn, "ptr check"
btn.top = button.bottom
btn.on_click = proc{
  p ptr
  p ptr.size if ptr
  p ptr[0] if ptr
}

form.show
Phi.mainloop
