Search code examples
pythontkintergridtkinter-entry

Tkinter grid() Manager


I am having a bit of trouble with the Tkinter grid() manager. It is spacing the rows too far apart. I have two entry widgets to place, and I need one almost directly under the other. When I place them both on the same row and column, but change the pady option, it places them directly on top of each other. I know there has to be a way to fix this, never had this problem before.

I am using Python 2.6 on Windows XP.


Solution

  • Don't place them in the same row and column; place the upper in a row, and the lower in row+1, both in the same column. That does the trick.

    Note that the grid manager does not need to have all rows and columns filled with widgets; it ignores empty rows and columns.