require 'tk'

def main
  root = TkRoot.new
  l1 = TkLabel.new(root,  => )
  e1 = TkEntry.new(root)
  l2 = TkLabel.new(root,  => )
  e2 = TkEntry.new(root) do
    validate 
    validatecommand lambda {e2.value.to_i == 75_000}
    invalidcommand  lambda {focus_number_entry(e2)}
  end
  ok = TkButton.new(root) do
    text 
    command lambda {validate_input(e1, e2)}
  end
  Tk.grid(l1, e1)
  Tk.grid(l2, e2)
  Tk.grid(,ok,  => )  
  Tk.mainloop
end

def validate_input(text_entry, number_entry)
  if number_entry.value.to_i!= 75_000
    focus_number_entry(number_entry)
  else
    puts %Q{You entered:  and }
    root.destroy
  end
end

def focus_number_entry(widget)
  widget \
    .configure( => ,  => ) \
    .selection_range(0, ) \
    .focus
end

main