Nov-16-2019, 05:30 PM
Hi, I just spent 3 hours on something I cannot understand:
I'm trying to re-size a Text element, but it replies me :
It is very strange as text elements has a size argument.
Here is the code:
I have tried finalizing window (even if I'm reading it before the update so that should not be mandatory,
I've tried passing the tyo arguments at the same time,
I went for hours to find a solution in the documentation and on internet without any result.
Any idea ?
Thanks in advance
I'm trying to re-size a Text element, but it replies me :
Quote:window.Element('-DISPLAY-').Update(size = (45,nb_lines))
TypeError: Update() got an unexpected keyword argument 'size'
It is very strange as text elements has a size argument.
Here is the code:
mycolumn =[
[sg.InputText(,key='-VOLUME-',focus=True)],
[],
[sg.InputText(key='-SOLUTION-',size=(45,3))],
[],
[sg.Button('Display')]]
layout =[ [sg.Text("Nothing to display",key='-DISPLAY-',size=(20,5)),sg.Column(mycolumn)]]
window = sg.Window('Display of a solution', layout).Finalize()
while True:
event, values = window.Read()
if event in (None, 'Quit'):
# logger.warning("User manual exit")
break
if event == 'Display':
displayed_message = mystring
nb_lines = 1+2*displayed_message.count("]]")
window.Element('-DISPLAY-').Update(displayed_message)
window.Element('-DISPLAY-').Update(size = (45,nb_lines))
window.Close()the update of displayed_message works ok, but the other trows at me the error messageQuote:window.Element('-DISPLAY-').Update(size = (45,nb_lines))
TypeError: Update() got an unexpected keyword argument 'size'
I have tried finalizing window (even if I'm reading it before the update so that should not be mandatory,
I've tried passing the tyo arguments at the same time,
I went for hours to find a solution in the documentation and on internet without any result.
Any idea ?
Thanks in advance
