Maybe this will help
import tkinter as tk root = tk.Tk() canvas = tk.Canvas(root, bg='green', width=1200, height=950) canvas.pack(fill='both', expand = True, padx=10, pady=10) mytext = canvas.create_text(0, 0, fill='lime', tags=['event']) def show(event): canvas.itemconfigure('event', text=f'Width -> {event.width} Height -> {event.height}') xpos = (event.width/2) ypos = (event.height/2) canvas.coords(mytext, xpos, ypos) if event.width > 1210: canvas.itemconfigure('event', font=('helvetica 60 bold')) else: canvas.itemconfigure('event', font=('helvetica 30 normal')) canvas.bind('<Configure>', show) root.mainloop()
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags