Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement