Code:
from tkinter import Tk, Buttonroot = Tk()Button(root, text="Exit", command=root.destroy).pack()root.protocol("WM_DELETE_WINDOW", lambda: print("Use of X is not allowed"))root.mainloop()
Saw it too late. You have to address the window instead of root. AFIK Picamera uses on the desktop QtGL. This is a complete different framework. You could figure out how to address the new window which were created by Qt or you make your own preview window, which allows you full control.I want to set this callback only for the image preview window and not the root window, but the picamera2 library hides this.
Statistics: Posted by DeaD_EyE — Thu Aug 15, 2024 9:34 am