Advertisement
Guest User

Untitled

a guest
Dec 7th, 2015
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.71 KB | None | 0 0
  1. #!/usr/bin/env ruby
  2.  
  3. require 'tk'
  4.  
  5. root = TkRoot.new do
  6.     icon = TkPhotoImage.new('file' => 'icon.png')
  7.     iconphoto(icon)
  8.     title 'Example'
  9.     resizable 0, 0
  10. end
  11.  
  12. label_of_telephone_or_email = TkLabel.new(root) do
  13.     text 'Telephone or email:'
  14.     pack
  15. end
  16.  
  17. entry_of_telephone_or_email = TkEntry.new(root) do
  18.     pack
  19. end
  20.  
  21. label_of_password = TkLabel.new(root) do
  22.     text 'Password'
  23.     pack
  24. end
  25.  
  26. entry_of_password = TkEntry.new(root) do
  27.     show '*'
  28.     pack
  29. end
  30.  
  31. button_of_login = TkButton.new(root) do
  32.     text 'Log in'
  33.     command { login }
  34.     pack
  35. end
  36.  
  37. def login
  38.     telephone_or_email = entry_of_telephone_or_email.get
  39.     password = entry_of_password.get
  40. end
  41.  
  42. Tk.mainloop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement