Найти - Пользователи
Полная версия: Закрытие окна tkinter
Начало » GUI » Закрытие окна tkinter
1
Andrew22528
Всем привет. Как в tkinter python3 сделать чтобы окно не закрывалось при нажатии на крестик и про Alt+F4?
4kpt_III
protocol(name=None, func=None)
Registers a callback function for the given protocol. The name argument is typically one of “WM_DELETE_WINDOW” (the window is about to be deleted), “WM_SAVE_YOURSELF” (called by X window managers when the application should save a snapshot of its working set) or “WM_TAKE_FOCUS” (called by X window managers when the application receives focus).

т.е.

root.protocol("WM_DELETE_WINDOW", your_callback)
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB