0
votes

sorry is the title is weird, stack overflow is making me re-phrase my question. I am trying to draw a simple line in Tkinter using canvas, this is my code so far

from tkinter import *
from tkinter.ttk import *
rt = Tk()
rt.geometry('500x500')
head = Canvas(rt, width=500, height=100)
head.create_line(1, 99, 499, 99)
rt.mainloop()

however when I run the program I only get a plain white screen. I honestly have no clue what i'm doing wrong. sorry if this is a stupid question.

You never actually added the Canvas to your window - typically by either the .pack() or .grid() methods. - jasonharper