class Module
  alias __extend_object__ extend_object
  def extend_object(obj)
    __extend_object__(obj)
    obj.instance_eval {on_extend}
  end
  def on_extend
  end

##  property not found (Phi::DelphiError)
##  c:/program files/apollo/bin/phi.rb:72:in `event_handle'
##  c:/program files/apollo/bin/phi.rb:72:in `extend'
##  c:/program files/apollo/bin/phi.rb:69:in `each'
##  c:/program files/apollo/bin/phi.rb:69:in `extend'
##  G:\Apollo\TkUtils\Module_on_extend.rb:23

end

if __FILE__ == $0
  require "phi"
  module FormXable
    def on_extend
      p :on_extend
      self.caption = "on_extend"
    end
  end
  form = Phi::Form.new
  form.extend FormXable
  form.show
  Phi.mainloop
end
