
# $Id: sample3.rb,v 1.3 2002/09/18 06:26:38 yuya Exp $

require 'vr/vruby'
require 'vr/vrcontrol'

class MyForm < VRForm

  def construct
    self.caption = 'Sample3'
    self.move(100, 100, 150, 160)
    self.addControl(VRButton, 'cmd_exit',  'Exit',      20, 20, 100, 40)
    self.addControl(VRButton, 'cmd_raise', 'Exception', 20, 70, 100, 40)
  end

  def cmd_exit_clicked
    messageBox('exit', 'Sample3', 0)
    exit
  end

  def cmd_raise_clicked
    messageBox('raising an exception from now.', 'Sample3', 0)
    raise 'This is an exception.'
  end

end

VRLocalScreen.showForm(MyForm)
VRLocalScreen.messageloop
