jarvisteach / appJar

Simple Tkinter GUIs in Python
http://appJar.info
Other
613 stars 68 forks source link

widget alignment #484

Closed Binxlola closed 5 years ago

Binxlola commented 6 years ago

I am having an issue with neat alignment of widget in a frame, specifically LabelFrame. When the labels are added they sort of position themselves with a lot of vertical space. I have tried app.setSticky() which doesn't seem to fix the issue. I am not sure what else there is to do? I will attach a picture of exactly what happens.

image

jarvisteach commented 5 years ago

Think of the labelFrame as a grid, it has two rows, each using 50% of the vertical space. The two labels are each in a row, and are at the top of that row. Changing sticky, determines where the label will appear in its row.

You need to change how the grid stretches to fill the labelFrame. If you set stretch to be 'none', then the grid won't expand down, and you'll get it all at the top:

with app.labelFrame('demo'):
    app.stretch = 'none'
    app.label('one')
    app.label('two')
    app.label('three')