Im trying to get my scrollbar to scroll, I've tried so many different commands and codes and none of them seem to work for me for some reason I can't understand. If I try adding a command like yview or yscrollcommand, then the text dissapears and it still doesnt scroll.
from tkinter import *
from functools import partial
import tkinter as tk
words = ["test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test",
"test", "test", "test", "test""test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test", "test"]
def validateLogin(password):
print(password.get())
if password.get() == "test":
master = Tk()
master.state('zoomed')
canvas_width = 1920
canvas_height = 1080
w = Canvas(master, width=canvas_width, height=canvas_height)
scrollbar = Scrollbar(master)
scrollbar.pack(side=RIGHT, fill=Y)
count = 20
for word in words:
w.create_text(150, count, text=word)
count += 20
w.pack()
tkWindow.destroy()
mainloop()
if password.get() != "test":
Label(tkWindow, text="Wrong password!", fg='red').grid(row=5, column=2)
# window
tkWindow = Tk()
tkWindow.geometry('250x100')
tkWindow.title('Passwords')
# password label and password entry box
Label(tkWindow, text="Password").grid(row=1, column=0)
password = StringVar()
Entry(tkWindow, textvariable=password,
show='*').grid(row=1, column=2)
validateLogin = partial(validateLogin, password)
# login button
Button(tkWindow, text="Login",
command=validateLogin).grid(row=4, column=2)
tkWindow.mainloop()