#! ruby -Ks
require "phi"
form = Phi::Form.new
button = Phi::Button.new form
page_control = Phi::PageControl.new form
tab_sheet_a = Phi::TabSheet.new page_control , :zero , "zero"
tab_sheet_b = Phi::TabSheet.new page_control , :one  , "one"
button.align = Phi::AL_TOP
page_control.align = Phi::AL_CLIENT

def tab_sheet_a.do_hide
  super
  p 'tab_sheet_a.do_hide'
end
def tab_sheet_a.on_hide
  p 'tab_sheet_a.on_hide'
end

button.on_click=proc{
  case page_control.active_page.page_index
  when 0
    p "‚º‚ë"
    tab_sheet_a.tab_visible = false
    tab_sheet_b.tab_visible = true
  when 1
    p "‚¢‚¿"
    tab_sheet_a.tab_visible = true
    tab_sheet_b.tab_visible = false
  end
}
form.show
Phi.mainloop
