Q:

Positioning a textbox on tkinter

I'm new to tkinter and it'll be a while till I get used to it. At the moment I'm trying to move a textbox around just to see how it works, but I can't really get it to move from the center. Tried using grid and it didn't move at all. Tried using pad x & y and it did move but in some places disappears. My goal is to make a simple log in screen. 
This is what I got:  
from tkinter import *

import tkinter.messagebox

    #def logVali():

form = Tk()

form.title("Log in screen")

form.geometry("700x200+300+200")

txtVar = StringVar(None)

usrIn = Entry(form, textvariable = txtVar, width = 50)

usrIn.grid(row = 30, column = 40)

usrIn.pack()

form.mainloop()

Any suggestions? Thanks

A:

Your box probably isn't moving as you are using .grid and .pack
Depending on what you want, you could use either the .grid , .pack , or .place functions. You've already seen grid. And pack and place work like so:
.place(x=10,y=30) #replace values with required

This works for positioning absolutely, however it falls down when you come to resize the window. If a user dragged the window bigger; the box would stay in the position you set. In other words, the coordinates are not relative to the size of the window. 
You have already used .pack , however you used it strangely so I'll explain. 
.pack() 

This will place the box in the centre, and the next item you use .pack() for will place it underneath the last. This is useful for making sure nothing overlaps, but it's not always practical and/or good looking. 
One last word of warning; all of these three functions return None. That means that it you intend to edit the boxes in anyway: call the function seperatly. 
#Some tutorials will say....
Button1 = Button(text="foo",command=bar).pack()

#However you should do this...
Button1 = Button(text="foo,command=bar)
Button1.pack()

