Shoes.app(title: ) do
  stack do
    textbox = edit_line

    textbox.change do
      textbox.text = textbox.text.gsub(/[^\d]/, '') and alert  if textbox.text!~ /^\d*$/
    end

    flow do
      button  do
        textbox.text = textbox.text.to_i + 1
      end

      button  do
        textbox.text = rand 5000 if confirm 
      end
    end
  end
end