Advertisement
Narzew

Kurs Ruby & Shoes - Odcinek 8

Aug 29th, 2015
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.77 KB | None | 0 0
  1. #encoding: utf-8
  2. # KURS RUBY & SHOES: https://www.youtube.com/watch?v=kIrWFPyZMwI&index=1&list=PLcbGBiker9IJwokPtnPaz_SwovRfVtvWr
  3. Shoes.app title: "Edit line i edit box", width:800, height:600, resizable: false do
  4.     def show_info(x)
  5.         alert x
  6.     end
  7.     def hide_login
  8.         @login.text = "Hacker" if @login != nil
  9.         @password.text = "Sekret" if @password != nil
  10.         @description.text = "Hacker" if @description != nil
  11.     end
  12.     def main_screen
  13.         stack {
  14.             title "Edytowalne pola"
  15.             caption "Podaj login"
  16.             @login = edit_line
  17.             @password = edit_line
  18.             @password.style(secret: true)
  19.             @description = edit_box
  20.             button("Wyświetl komunikat") { show_info(@login.text+"\n"+@password.text+"\n"+@description.text) }
  21.             button("Ukryj login") { hide_login }
  22.         }
  23.     end
  24.     main_screen
  25. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement