require "phi"

form = Phi::Form.new
bar1 = Phi::ProgressBar.new form
bar2 = Phi::ProgressBar.new form
bar3 = Phi::ProgressBar.new form
label = Phi::Label.new form
bar1.max = 24
bar2.max = 60
bar3.max = 60

#bar1.show_caption = true
#bar2.show_caption = true
#bar3.show_caption = true
#undefined method `show_caption=' for #<Phi::ProgressBar:0x10ad4c8> (NameError)
p bar1.caption
bar1.caption = "start"
#undefined method `caption=' for #<Phi::ProgressBar:0x10ad4c8>(NameError)

bar1.smooth = true
bar2.smooth = true
bar3.smooth = true
bar2.top = bar1.bottom
bar3.top = bar2.bottom
label.top = bar3.bottom

timer = Phi::Timer.new
timer.on_timer = proc{
  now = Phi::DateTime.now
  bar1.position = now.hour
  bar2.position = now.minute
  bar3.position = now.second
#  bar1.caption = now.hour.to_s
#  bar2.caption = now.minute.to_s
#  bar3.caption = now.second.to_s
  label.caption = now.to_s
}

form.show
Phi.mainloop
