Advertisement
Felanpro

login layout

Aug 14th, 2016
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.78 KB | None | 0 0
  1. '''
  2. Using the grid manager is easy. Just create the widgets, and use the
  3. grid function to tell the manager in which row and column to place them.
  4. You don’t have to specify the size of the grid beforehand; the
  5. manager automatically determines that from the widgets in it.
  6. '''
  7.  
  8. from tkinter import *
  9.  
  10. root = Tk()
  11.  
  12. '''Let's just define something real quick.
  13. row = vertically
  14. column = horizontally
  15. '''
  16.  
  17. label1 = Label(root, text = "Name:")
  18. label2 = Label(root, text = "Password:")
  19.  
  20. input1 = Entry(root)
  21. input2 = Entry(root)
  22.  
  23. check1 = Checkbutton(root, text = "Keep me logged in.")
  24.  
  25. label1.grid(row = 0, sticky = E) #E for east.
  26. label2.grid(row = 1, sticky = E)
  27.  
  28. input1.grid(row  = 0, column = 1)
  29. input2.grid(row = 1, column = 1)
  30.  
  31. check1.grid(column = 1)
  32.  
  33. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement