I've been playing around with tkinter a bit and I can't figure out why the "sticky" attribute doesn't seem to be working with my button. I've specified sticky to be NW which should cause my button to stick to the top left edge but for some reason it sticks to the top right. Any idea why?
from tkinter import *
from tkinter import ttk
def test():
name = userName.get()
text = "Hello {0}! Pleased to meet you.".format(name)
greeting.set(text)
window = Tk()
greeting = StringVar()
userName = StringVar()
name = Entry(window, textvariable=userName)
name.grid(column=1, row=1, sticky=NW)
button = Button(window, text="greeting", command=test)
button.grid(column=2, row=1, sticky=NW)
label = Label(window, textvariable=greeting)
label.grid(column=1, row=2, sticky=NW)
#creating a rectangle
canvas = Canvas(window)
canvas.grid(column=1, row=2)
#attributes are x,y coordinates of two points
x = canvas.create_rectangle(5,5,115,115)
mainloop()