Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''
- Using the grid manager is easy. Just create the widgets, and use the
- grid function to tell the manager in which row and column to place them.
- You donβt have to specify the size of the grid beforehand; the
- manager automatically determines that from the widgets in it.
- '''
- from tkinter import *
- root = Tk()
- '''Let's just define something real quick.
- row = vertically
- column = horizontally
- '''
- label1 = Label(root, text = "Name:")
- label2 = Label(root, text = "Password:")
- input1 = Entry(root)
- input2 = Entry(root)
- check1 = Checkbutton(root, text = "Keep me logged in.")
- label1.grid(row = 0, sticky = E) #E for east.
- label2.grid(row = 1, sticky = E)
- input1.grid(row = 0, column = 1)
- input2.grid(row = 1, column = 1)
- check1.grid(column = 1)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement