-
-
Save anonymous/6eed2ac2b02c4b3bd72f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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