#ruby -Ks
require 'phi' ; include  Phi 

module Phi
class Canvas
  def draw_text(str,rect=nil,option=0,count=-1)
    rect ||= self.rect
    Phi.draw_text(handle,str,count,rect,option)
  end
end
end

form = Form.new
form.on_paint=proc{
  form.canvas.text_out(10,10,"text_out")
  option = DT_RIGHT | DT_BOTTOM | DT_SINGLELINE
  draw_text(form.canvas.handle,"draw_text(right & bottom)",-1,form.client_rect,option)
  option = DT_LEFT | DT_BOTTOM | DT_SINGLELINE
  form.canvas.draw_text("draw_text(left & bottom)",form.client_rect,option)
  nil
}
form.show
mainloop
