Advertisement
Guest User

Untitled

a guest
Feb 3rd, 2016
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. from gi.repository import Gtk
  2.  
  3. import base64
  4.  
  5. class classInputs(Gtk.Window):
  6. def __init__(self):
  7.  
  8. Gtk.Window.__init__(self, title="Inputs try window")
  9. self.set_border_width(10)
  10. self.set_size_request(200,100)
  11.  
  12.  
  13.  
  14.  
  15. # Layout
  16. vertical_box = Gtk.Box(orientation = Gtk.Orientation.VERTICAL, spacing = 8)
  17. self.add(vertical_box)
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. #userName input
  25. self.username = Gtk.Entry()
  26. self.username.set_text("")
  27. vertical_box.pack_start(self.username, True, True, 0)
  28.  
  29.  
  30.  
  31.  
  32. #Password input
  33. self.password = Gtk.Entry()
  34. self.password.set_text("aaaaaaaaaaa")
  35. self.password.set_visibility(False)
  36. vertical_box.pack_start(self.password, True, True, 0)
  37.  
  38.  
  39.  
  40.  
  41. #create login botton here
  42. self.button = Gtk.Button(label="click me to login")
  43. self.button.connect("clicked", self.function)
  44. vertical_box.pack_start(self.button, True, True, 0)
  45.  
  46. #create label
  47. self.label= Gtk.Label()
  48. vertical_box.pack_start(self.label, True, True, 0)
  49.  
  50.  
  51.  
  52.  
  53.  
  54. #function of the button here bech ki tenzel 3al button y7ot lencode fel input 1
  55. def function (self, widget):
  56. self.label.set_text(base64.b64encode(b'data to be encoded'))
  57.  
  58. shinerghost = classInputs()
  59. shinerghost.connect("delete-event",Gtk.main_quit)
  60. shinerghost.show_all()
  61. Gtk.main()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement