-2
I am trying to create an interface where the user can type a text and save that text in a txt document. To make the process easier, I used a Guis generator called PAGE, which uses the Tkinter package, which already comes with Python. The code that PAGE generated was the following:
class New_Toplevel:
def __init__(self, top=None):
self.Text1 = Text(top)
self.Text1.place(relx=0.017, rely=0.133, relheight=0.831,
relwidth=0.94)
self.Text1.configure(background="white")
self.Text1.configure(font="TkTextFont")
self.Text1.configure(foreground="black")
self.Text1.configure(highlightbackground="#d9d9d9")
self.Text1.configure(highlightcolor="black")
self.Text1.configure(insertbackground="black")
self.Text1.configure(selectbackground="#c4c4c4")
self.Text1.configure(selectforeground="black")
self.Text1.configure(width=564)
self.Text1.configure(wrap=WORD)
The problem is I can’t recover the text from the window. I tried to use the get() method, but it does not return anything, and I can’t call the Text1 object from outside the class, so I can use the solution they gave in this post: https://stackoverflow.com/questions/14824163/how-to-get-the-input-from-the-tkinter-text-box-widget
Some solution?