user2683689
user2683689

Reputation: 23

Tkinter's .grid() not aligning things, I'm at my wits end

I've been working on a program for a while, that deals with taking users input, and at one point, making a table with it, and asking them to edit anything they need to. I'm using Tkinter, and it's too late for me to change that. I have 3 frames, the first being a Pmw Scrolled Frame, the second being left_frame, inside of the main one, and the third is right_frame. On the left side I have a bunch of Labels, and then on the right, I have several OptionMenus and Entries. The problem is, no matter what I try, I cannot seem to make them aligned. I have been at this forever. Here is the relevant code: http://pastebin.com/S7yMmacG

You can ignore all of the functions there, they work and are unrelated to the alignment, sorry if it's messy. As for seeing what is actually happening, he is an image of the issue

https://i.sstatic.net/gpeuD.png

I've tried using .pack(), .place(), but none of it works. If anyone could help that would be amazing, I have been at this forever and I really don't know what to do at this point. Thanks

Upvotes: 0

Views: 1511

Answers (1)

sundar nataraj
sundar nataraj

Reputation: 8702

they are not alligned because all your updating them to row

in grid we have .grid(row=x,cloumn=x)

let say for description label and feild to be aligned they should have same row and different column

keep discription label at row=0 and column=0 and its textfeild at row=0 and column=1

and they all should belong to same frame . please not to use different frames for this purpose

to have fixed width for column you have grid_configure you can change by myframe.grid_congfigure(column=0,minsize=150) this size will be constant throughout the frame for column 0

you can learn from docs

Upvotes: 1

Related Questions