TL;DR:
Text widget expands further than a specified column, row combo of a grid() call. Only resolution comes from changing the .width and .height attributes to something small and forcing the sticky flag of the call to expand and fill using 'nsew'.
Background:
The Text widget has sparked some confusion for me, take for example the following:
root = Tk()
root.geometry('400x400')
root.grid_columnconfigure(0, weight = 1)
root.grid_columnconfigure(1, weight = 1)
root.grid_rowconfigure(0, weight = 1)
root.grid_rowconfigure(1, weight = 1)
b = Button(root)
b.grid(column = 0, row = 0, sticky = 'nsew')
t = Text(root)
t.grid(column = 1, row = 1, sticky = 'nsew')
Given this, I should have a 400x400 Window like:
+-------+-------+
| | |
| b | |
| | |
+-------+-------+
| | |
| | t |
| | |
+-------+-------+
But what ends up happening is that the Text widget goes well beyond the lower right column, row:
+---+-----------+
| b | |
+---+ |
| | t |
| | |
| | |
| | |
+---+-----------+
The only way to resolve this is to alter the Text widget like so:
t = Text(root, height = 1, width = 1)
Then the sticky call expands the widget to only fit within the column, row of the grid. This however, seems like an extra step I shouldn't have to take even though the Text widget defaults to a .width and .height like all the other widgets.
Question: Why does the Text widget expand beyond the specified column, row of a grid?
