Merge pull request #1522 from PySimpleGUI/Dev-latest

Yet more wrap fixes
This commit is contained in:
MikeTheWatchGuy 2019-06-04 10:32:48 -04:00 committed by GitHub
commit 442c96b832
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -5183,11 +5183,11 @@ def PackFormIntoFrame(form, containing_frame, toplevel_form):
tktext_label = element.Widget = tk.Label(tk_row_frame, textvariable=stringvar, width=width,
height=height, justify=justify, bd=border_depth, font=font)
# Set wrap-length for text (in PIXELS) == PAIN IN THE ASS
wraplen = tktext_label.winfo_reqwidth() - 10 # width of widget in Pixels
wraplen = 0
if not auto_size_text and height == 1:
wraplen = 0
else:
wraplen = width
elif not auto_size_text:
wraplen = tktext_label.winfo_reqwidth() - 10 # width of widget in Pixels
tktext_label.configure(anchor=anchor, wraplen=wraplen) # set wrap to width of widget
if element.Relief is not None:
tktext_label.configure(relief=element.Relief)