jarvisteach / appJar

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

Set individual widget stretchiness #524

Closed kendomastr closed 6 years ago

kendomastr commented 6 years ago

I just started using appJar in the last 24 hours and love the simplicity of it. I am able to do almost everything I want to do for a GUI, but I am running into some layout issues. My GUI is supposed to have a Label widget followed by a File Entry widget below it to start. Once a file is entered, I call a function to create a ScrollPane below the File Entry widget and then do some stuff on the file and show a bunch of Labels and Entries within the ScrollPane.

So far, so good.

After the ScrollPane is created, if I resize the GUI, the heights of the Label and File Entry widget increase so those two plus the ScrollPane all have the same height. What I want is the height of the Label and File Entry widget to stay fixed, but let the ScrollPane take all the rest of the space.

If I use app.setStretch("column"), I get the height fixed for the Label and File Entry, but the ScrollPane also gets fixed so I can resize to a huge GUI, but the height of the ScrollPane won't increase after a certain point. This makes sense as the command applied Stretch to all widgets in the app. I then tried something like app.setStretch("textlabel","column") to fix just the Label, but that function doesn't seem to exist.

Is there a way to set stretchiness for individual widgets?

jarvisteach commented 6 years ago

When you set stretch, it will apply to all future widgets. So setting it multiple times, before different widgets, will effectively set the stretchiness of those widgets. You may also need to set the stickiness, to get the widget to stick to the sides of its cell. Have you had a look through here: http://appjar.info/pythonWidgetLayout/#widget-positioning

If you post a sample of code, so I can reproduce the issue, I can make some suggestions...

kendomastr commented 6 years ago

Aha! This works! I did read that section, but it wasn't clear to me that you could set it multiple times before each widget to provide individual settings to the widget. Now that I reread that sentence, it makes sense. The line where it says it can be set for individual widgets makes it sound like there's a separate function like the .setXXXSticky() for Stretch for individual widgets.

Anyway, thank you for the help! This package is amazing and really allows me to quickly develop simple GUIs! Please keep up the great work!

On Sat, Aug 18, 2018 at 11:11 AM Richard Jarvis notifications@github.com wrote:

When you set stretch, it will apply to all future widgets. So setting it multiple times, before different widgets, will effectively set the stretchiness of those widgets. You may also need to set the stickiness, to get the widget to stick to the sides of its cell. Have you had a look through here: http://appjar.info/pythonWidgetLayout/#widget-positioning

If you post a sample of code, so I can reproduce the issue, I can make some suggestions...

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jarvisteach/appJar/issues/524#issuecomment-414076506, or mute the thread https://github.com/notifications/unsubscribe-auth/AX_zPr23bA3ewjZpMnl6WSbLmForS7IUks5uSFjCgaJpZM4WCcbZ .

jarvisteach commented 6 years ago

Thanks for the feedback, documentation feedback is just as important as bugs! I've made a few changes to that page for the next release.