jarvisteach / appJar

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

app.separator() in labelFrame(sticky="news") not scaling #540

Closed tnsolley closed 5 years ago

tnsolley commented 5 years ago

Bug Report


Context


Attempting to create a test GUI for a project; each TabFrame represents a function-call, and will display certain variables as Entries with Labels next to them. To add to the visual aesthetic, and to separate certain variables, I am attempting to add VerticalSeparator() and HorizontalSeparator() in varying manners on each tab---essentially creating variations on a "grid" theme for each Tab.

Expected Behaviour


Separators, of the <.addHorizontalSeparator(row, column, colspace)> to span the full listed with sticky="news" for the Tab the LabelFrame is a member of.

Actual Behaviour


All horizontal separators are a fixed pixel-size in length, regardless of length of .

Any error messages produced by appJar


2018-10-04 11:16:18,316 appJar:WARNING [Line 4127->2283/setSize]: Specified dimensions (300, 350) less than requested dimensions (378, 265) 2018-10-04 11:16:19,505 appJar:WARNING [Line 4193->2283/setSize]: Specified dimensions (300, 350) less than requested dimensions (378, 265) 2018-10-04 11:16:19,739 appJar:WARNING [Line 4204->2283/setSize]: Specified dimensions (300, 350) less than requested dimensions (378, 265) 2018-10-04 11:16:20,913 appJar:WARNING [Line 4288->2283/setSize]: Specified dimensions (300, 350) less than requested dimensions (378, 265) 2018-10-04 11:16:21,089 appJar:WARNING [Line 4297->2283/setSize]: Specified dimensions (300, 330) less than requested dimensions (460, 373)

Sample code, demonstrating the issue


`# Results screen with app.tab("Results", bg="slategrey", sticky="news"): with app.labelFrame("Test Results"):

app.addImage("subPanel", "subpanel.png", row=0, column=0, colspan=10)

    app.separator(row=1, column=0, colspan=19)
    app.addVerticalSeparator(row=2, column=1, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=3, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=5, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=6, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=9, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=11, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=13, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=15, colspan=1, rowspan=4)
    app.addVerticalSeparator(row=2, column=17, colspan=1, rowspan=4)
    app.label("sn0", "sn0", row=2, column=0, colspan=1, tip="DUT0 SN#")
    app.label("sn1", "sn1", row=2, column=2, colspan=1, tip="DUT1 SN#")
    app.label("sn2", "sn2", row=2, column=4, colspan=1, tip="DUT2 SN#")
    app.label("sn3", "sn3", row=2, column=6, colspan=1, tip="DUT3 SN#")
    app.label("sn4", "sn4", row=2, column=8, colspan=1, tip="DUT4 SN#")
    app.label("sn5", "sn5", row=2, column=10, colspan=1, tip="DUT5 SN#")
    app.label("sn6", "sn6", row=2, column=12, colspan=1, tip="DUT6 SN#")
    app.label("sn7", "sn7", row=2, column=14, colspan=1, tip="DUT7 SN#")
    app.label("sn8", "sn8", row=2, column=16, colspan=1, tip="DUT8 SN#")
    app.label("sn9", "sn9", row=2, column=18, colspan=1, tip="DUT9 SN#")
    app.label("dutHWcheckRes0", "Voq0 pending", row=3, column=0, colspan=1, tip="Voq Results, DUT0. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes1", "Voq1 pending", row=3, column=2, colspan=1, tip="Voq Results, DUT1. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes2", "Voq2 pending", row=3, column=4, colspan=1, tip="Voq Results, DUT2. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes3", "Voq3 pending", row=3, column=6, colspan=1, tip="Voq Results, DUT3. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes4", "Voq4 pending", row=3, column=8, colspan=1, tip="Voq Results, DUT4. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes5", "Voq5 pending", row=3, column=10, colspan=1, tip="Voq Results, DUT5. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes6", "Voq6 pending", row=3, column=12, colspan=1, tip="Voq Results, DUT6. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes7", "Voq7 pending", row=3, column=14, colspan=1, tip="Voq Results, DUT7. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes8", "Voq8 pending", row=3, column=16, colspan=1, tip="Voq Results, DUT8. 'PASS', or Errorcode given.")
    app.label("dutHWcheckRes9", "Voq9 pending", row=3, column=18, colspan=1, tip="Voq Results, DUT9. 'PASS', or Errorcode given.")
    app.label("s1_result", "Vout0 pending", row=4, column=0, colspan=1, tip="Vout Test Results, DUT0")
    app.label("s2_result", "Vout1 pending", row=4, column=2, colspan=1, tip="Vout Test Results, DUT1")
    app.label("s3_result", "Vout2 pending", row=4, column=4, colspan=1, tip="Vout Test Results, DUT2")
    app.label("s4_result", "Vout3 pending", row=4, column=6, colspan=1, tip="Vout Test Results, DUT3")
    app.label("s5_result", "Vout4 pending", row=4, column=8, colspan=1, tip="Vout Test Results, DUT4")
    app.label("s6_result", "Vout5 pending", row=4, column=10, colspan=1, tip="Vout Test Results, DUT5")
    app.label("s7_result", "Vout6 pending", row=4, column=12, colspan=1, tip="Vout Test Results, DUT6")
    app.label("s8_result", "Vout7 pending", row=4, column=14, colspan=1, tip="Vout Test Results, DUT7")
    app.label("s9_result", "Vout8 pending", row=4, column=16, colspan=1, tip="Vout Test Results, DUT8")
    app.label("s10_result", "Vout9 pending", row=4, column=18, colspan=1, tip="Vout Test Results, DUT9")
    app.label("s1_errorcode", "DUT0 Failures pending", row=5, column=0, colspan=1, tip="DUT0 Failures (if applicable).")
    app.label("s2_errorcode", "DUT1 Failures pending", row=5, column=2, colspan=1, tip="DUT1 Failures (if applicable).")
    app.label("s3_errorcode", "DUT2 Failures pending", row=5, column=4, colspan=1, tip="DUT2 Failures (if applicable).")
    app.label("s4_errorcode", "DUT3 Failures pending", row=5, column=6, colspan=1, tip="DUT3 Failures (if applicable).")
    app.label("s5_errorcode", "DUT4 Failures pending", row=5, column=8, colspan=1, tip="DUT4 Failures (if applicable).")
    app.label("s6_errorcode", "DUT5 Failures pending", row=5, column=10, colspan=1, tip="DUT5 Failures (if applicable).")
    app.label("s7_errorcode", "DUT6 Failures pending", row=5, column=12, colspan=1, tip="DUT6 Failures (if applicable).")
    app.label("s8_errorcode", "DUT7 Failures pending", row=5, column=14, colspan=1, tip="DUT7 Failures (if applicable).")
    app.label("s9_errorcode", "DUT8 Failures pending", row=5, column=16, colspan=1, tip="DUT8 Failures (if applicable).")
    app.label("s10_errorcode", "DUT9 Failures pending", row=5, column=18, colspan=1, tip="DUT9 Failures (if applicable).")
    app.addHorizontalSeparator(row=6, column=0, colspan=19, rowspan=1)
    app.addButtons(["Continue Batch", "New Batch", "Quit Results"], s4)
  # End with-statement
# End with-statement`

What steps are needed to reproduce the bug


Code is a modified version of the AppJar Showcase file (being used for demonstration purposes only, and Proof of Concept). Add the above code (there are other tabs I made, above is the worst case) within the with app.tabbedFrame("Tabs"): section.

Version Information


Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32 Windows 10 AppJar 0.9.3

jarvisteach commented 5 years ago

I've had a quick look at this, and by default the horizontal separator doesn't stretch. But, when I set sticky, it does stretch the width of the columns:

with gui('separators', '400x100') as app:
     with app.labelFrame("Test Results"):
#         app.sticky = 'news'
         app.separator(row=0, column=0, colspan=19, sticky='news')

You can set sticky as a standalone property for the container, or as a parameter to adding the separator.

tnsolley commented 5 years ago

@jarvisteach The method you suggested works, thank you so much! Having an issue with <addScrolledTextArea()>, and getting that to scale horizontally, too [opening in new issue].