The following code works for Entry(), but when I use ScrolledText() it fails to work.
from tkinter import *
from tkinter.scrolledtext import *
def click():
a = text1.get()
print(a)
window = Tk()
window.title("TITLE PLACEHOLDER")
Label(window,text="Subject", bg="black",fg="white", font="Arial 10").grid(row=1,column=0,sticky=W)
text1 = ScrolledText(window,bg="white", width=50,font="Arial 10")
text1.grid(row=2,column=0,sticky=W)
Button(window, text="send",width=6,command=click).grid(row=3,column=0,sticky=W)
window.mainloop()
Error:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\user\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 1699, in __call__
return self.func(*args)
File "C:\Users\user\Desktop\folder_name\testing.py", line 5, in click
a = text1.get()
TypeError: get() missing 1 required positional argument: 'index1'
Any suggestions?