I write this simple code:
from tkinter import *
from tkinter import ttk
import tkinter.scrolledtext
root = Tk()
textPad = tkinter.scrolledtext(root)
textPad.pack()
root.mainloop()
But not run. output is:
Traceback (most recent call last):
File "E:/m/lale/test/test.py", line 6, in <module>
textPad = tkinter.scrolledtext(root)
TypeError: 'module' object is not callable
You are almost there. You need the ScrolledText class from the scrolledtext module. This works.
import tkinter as tk
from tkinter.scrolledtext import ScrolledText
root = tk.Tk()
textPad = ScrolledText(root)
textPad.pack()
root.mainloop()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With