Hi. Need some help with multiline.
I have a def function that create an interface and uses multiline to populate the file contents into it.
def LoginScreen():
global …
sg.theme(‘LightBlue1’)
loginlayout = [
…
…
[sg.Frame(’’,[[sg.Multiline(key=’-ml-’+sg.WRITE_ONLY_KEY, size=(131,15)) ]] )]
]
window = sg.Window(‘Login’, loginlayout, size=(1000,600))
def ViewFileinMultiFileArea():
global …
line = ‘ABCDEFGH’
window[’-ml-’+sg.WRITE_ONLY_KEY].print(line)
def main():
LoginScreen
ViewFileinMultiFileArea
the problem is: if I put this line
window[’-ml-’+sg.WRITE_ONLY_KEY].print(line)
within the loginscreen, it works and populates the mainline.
But the same line in ViewFileinMultiFileArea does not work.
it gives error like:
TclError: Invalid command name “.!toplevel134.!frame8.!labelframe.!frame.!frame.!scrolledtext”
and it gives error pointing at this line itself:
window[’-ml-’+sg.WRITE_ONLY_KEY].print(line)
Any help is really much appreciated.