Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created December 7, 2015 16:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/6eed2ac2b02c4b3bd72f to your computer and use it in GitHub Desktop.
Save anonymous/6eed2ac2b02c4b3bd72f to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'tk'
root = TkRoot.new do
icon = TkPhotoImage.new('file' => 'icon.png')
iconphoto(icon)
title 'Example'
resizable 0, 0
end
label_of_telephone_or_email = TkLabel.new(root) do
text 'Telephone or email:'
pack
end
entry_of_telephone_or_email = TkEntry.new(root) do
pack
end
label_of_password = TkLabel.new(root) do
text 'Password'
pack
end
entry_of_password = TkEntry.new(root) do
show '*'
pack
end
button_of_login = TkButton.new(root) do
text 'Log in'
command { login }
pack
end
def login
telephone_or_email = entry_of_telephone_or_email.get
password = entry_of_password.get
end
Tk.mainloop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment