Search code examples
python-3.xuser-interfacetkintertkinter-layout

Center and put multiple items on the same line using Tkinter


I want to put a Label and an Entry widgets on the same line and center them.

I saw on multiple posts that to center, pack() method was easier. But, to put on the same line, it's grid().

With grid(), I suppose I have to build all the layout, then center it. Is there a way to do it on the go? With pack(), I don't have any idea.

But, I want to do both at the same time. I didn't find any answer :/ If someone can help me, I will be very grateful!


Solution

  • I have to put everything in a frame and pack() the frame.

    Thanks to @acw1668