I am new to the tkinter
python module. I try to do a project. I learned something new about the menus and I'm trying to make a little UI project that allows the user to write something in a scrolled text widget and then save it (using the sys
module).
I've already tried some things that worked at buttons. For example .get()
but it didn't work. I also tried the ["text"]
method.
import tkinter, sys
root = tkinter.Tk()
class saveProject:
def __init__(self, master):
self.master = master
self.textFrame = tkinter.scrolledtext.ScrolledText(self.master, width=100, bd=10, relief="raised")
self.textFrame.pack()
def save(self):
#self.saveText = self.textFrame.get()
self.saveText = self.textFrame["text"]
project = saveProject(root)
root.mainloop()
The problem is, as I already said, I don't know how to get the text out of a tkinter.scrolledtext.ScrolledText
widget.