require "phi" ; include Phi
module Phi
  module_function
  def sleep sec
    last = Time.now + sec
    APPLICATION.process_messages while Time.now < last
  end
end

form_splash = Form.new :form_splash ,"しばらくお待ちください"
form_splash.show

Phi.sleep 5

form_splash.close  ## (1)ここだとＮＧ
form_main = Form.new :form_main , "メインフォーム"
form_main.show
#form_splash.close  ## (2)ここならＯＫ

mainloop
raise
