New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LabelFrame docs unclear - re. stickiness #203

Closed
steveo-ct opened this Issue Aug 8, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@steveo-ct

steveo-ct commented Aug 8, 2017

I added a text area to a label frame and set the colspan of the text area = 2. The text area does not span across the columns.

Below is the test code i tried. When adding the text area 'notes' to the frame, it doesn't span 2 columns. Just adding the text area 'notes2' outside the labelframe adjusts the textarea across 2 columns.

here's the code:
from appJar import gui

app = gui("Dyanmic Test")

labelEntryNames = ['name', 'location', 'type']
labelOptionValues = ['select one', 'laptop', 'desktop', 'HDD Only']

#label frame to contain fields
app.startLabelFrame('Main', colspan=2)

for en in labelEntryNames:
app.addLabelEntry(en, colspan=2)

app.addLabelOptionBox('Source', labelOptionValues, colspan=2)
app.addDatePicker('dp', colspan=2)
app.setDatePicker('dp')

app.addTextArea('notes', colspan=2)
app.stopLabelFrame()

#to test the span across the gui
app.addTextArea('notes2', colspan=2)

app.go()

@steveo-ct

This comment has been minimized.

Show comment
Hide comment
@steveo-ct

steveo-ct Aug 8, 2017

----Update----
After adding the textArea widget into the label frame, the stickiness of the text area widget has to be set to get it to span across the columns.

`#label frame to contain fields
app.startLabelFrame('Main')

for en in labelEntryNames:
app.addLabelEntry(en)

app.addLabelOptionBox('Source', labelOptionValues)
app.addDatePicker('dp')
app.setDatePicker('dp')

app.setSticky('nesw')
app.addTextArea('notes')
app.stopLabelFrame()`

steveo-ct commented Aug 8, 2017

----Update----
After adding the textArea widget into the label frame, the stickiness of the text area widget has to be set to get it to span across the columns.

`#label frame to contain fields
app.startLabelFrame('Main')

for en in labelEntryNames:
app.addLabelEntry(en)

app.addLabelOptionBox('Source', labelOptionValues)
app.addDatePicker('dp')
app.setDatePicker('dp')

app.setSticky('nesw')
app.addTextArea('notes')
app.stopLabelFrame()`

@jarvisteach

This comment has been minimized.

Show comment
Hide comment
@jarvisteach

jarvisteach Aug 8, 2017

Owner

In all these cases, colspan doesn't affect anything - it's only useful, if you've added widgets into multiple columns.

As you've worked out, how big the widget gets is down to its container's stickiness.

An appJar GUI will stick widgets to both sides E & W, but a LabelFrame only sticks widgets to the W edge. Setting sticky to EW is necessary in a LabelFrame, to get the widgets to fill expand across its width.

This is by design, although it's not specifically mentioned in the docs - I'll update the docs to make it clear that a LabelFrame works slightly differently to the appJar container - and give more examples.

Owner

jarvisteach commented Aug 8, 2017

In all these cases, colspan doesn't affect anything - it's only useful, if you've added widgets into multiple columns.

As you've worked out, how big the widget gets is down to its container's stickiness.

An appJar GUI will stick widgets to both sides E & W, but a LabelFrame only sticks widgets to the W edge. Setting sticky to EW is necessary in a LabelFrame, to get the widgets to fill expand across its width.

This is by design, although it's not specifically mentioned in the docs - I'll update the docs to make it clear that a LabelFrame works slightly differently to the appJar container - and give more examples.

@jarvisteach jarvisteach changed the title from TextArea in LabelFrame with colspan to LabelFrame docs unclear - re. stickiness Aug 9, 2017

@jarvisteach jarvisteach added this to the 0.08 milestone Aug 9, 2017

jarvisteach added a commit that referenced this issue Aug 9, 2017

@jarvisteach jarvisteach closed this Aug 9, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment