Search code examples
rubyuser-interfaceshoes

Ruby Shoes GUI Secret style not working


I am trying to make a login screen in Ruby Shoes. I am using the ask method to get the username and password but I want the password to show as asterisks. I have to use the secret method but I can't figure out the right syntax..

button "Login" do
    username = ask("Enter Username: ")
    password = ask("Enter Password: ") :secret => true
end

Should it be done this way?

password = ask("Enter Password: "), secret: true

I tried this too. It doesn't seem to work

Thanks!


Solution

  • Try it this way

      button "Login" do
        username = ask("Enter Username: ")
        password = ask("Enter Password: ", :secret => true)
      end