I'm having some issues with a ScrolledText widget in tkinter.
The Scrollbar is not showing up.
Here is my code:
from tkinter import *
import os
from tkinter.scrolledtext import ScrolledText
#window variables
win = Tk()
win.title('TextS')
win_width = 600
win_height = 400
win.geometry('{}x{}'.format(win_width,win_height))
#widgets
title = Label(win, text="TextS", font=("Helvetica", 36, "bold"), bg="lightgray")
title.grid(row=0, column=0)
st = ScrolledText(win, width=400, height=300)
st.grid(column=1, pady=10, padx=10)
#main loop
while True:
win.update()
Some Screen Shots:
With .grid() what I want to use: screenshot
With .pack() which I do not want to use: screenshot (Has scroll bar)
Sorry if this is a noobie mistake, Thank you!
Have a great day! :)
Using same code.
set
geometry
to 350x300In line 20 set
ScrolledText
towidth=40
,height=10
Set
column
to 0 not 1You're set to go.
Code:
Screenshot output: