I'm new to Tkinter, and I tried creating an app with the grid layout manager. However, I can't seem to find a way to utilize it the way I want to. What I need to do is simulate a grid full of 'cells' so that I can place, for example, a label in cell (3,8) or a button in cell (5,1). Here is an example of what I've tried:
import tkinter as tk
root = tk.Tk()
label = tk.Label(root, text = 'Label')
label.grid(column = 3, row = 8)
button = tk.Button(root, text = 'Button')
button.grid(column = 5, row = 1)
Tkinter keeps the relative position of each widget (i.e. button
is above and to the right of label
), but it ignores any space in between. I've searched a bit for this problem and found out about weight
, but that doesn't seem to be what I'm looking for; I'd like something independent of the label
and button
's layouts. Thanks for the help!