'When trying to position elements in tkinter all elements are moved

I'm using tkinter to create a very simple GUI just to start learning how to use the module. However I'm trying to position two elements (a button and a text box). To position the elements I'm using the grid function, however I have used grid for both the button and the textbox and it seems that both elements are affected by just one set of the parameters when I have two sets of parameters for positioning.

This is the code:

from tkinter import *
import tkinter as tk
from tkinter import ttk

gui = Tk()
gui.geometry("600x800")

button = ttk.Button(text="button")
button.grid(row=1, column=1,ipady=30, ipadx=30)

lowerframe = tk.Frame(gui)
lowerframe.grid(row=2, column=1, padx = 100)
tb = ttk.Entry(lowerframe, width= 20)
tb.grid(ipady=30, ipadx= 0)


gui.mainloop()

As you can see there are two different sets of parameters for the positioning of the button and the textbox however for some reason the button and the textbox end up being in the same position. So how can I make the parameters affect the elements they're intended to affect?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source