0

I am learning & working to create GUIs with python functions. but when creating buttons and text entry using the grid(), below the buttons alignments are changing.

before showing text entry,

enter image description here

after showing text entry,

enter image description here

Elias Fizesan
  • 265
  • 1
  • 3
  • 18
MathanKumar
  • 543
  • 1
  • 4
  • 17
  • Their allignments aren't changing, the grid size is changing and the objects inside are acting accordingly (by not changing...) – Max Jul 27 '20 at 13:48
  • @Max, thank you. now i did understand that. but i don't know how show the text entry without affecting grids. more over pack() options are not suitable to me – MathanKumar Jul 27 '20 at 13:52
  • @Mathan you could find your answer here https://stackoverflow.com/questions/63014842/how-to-stretch-cell-horizontally-using-grid-in-tkinter/63015055#63015055 – Thingamabobs Jul 27 '20 at 14:07

1 Answers1

0

You're adding a wide element to a narrow column, so the column expands to fit the entry.

In your case you probably want to add columnspan=2 (or 3, or 4, depending on what you want to happen) when you add the entry to the display.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685