Форум сайта python.su
Всем привет. Как в tkinter python3 сделать чтобы окно не закрывалось при нажатии на крестик и про Alt+F4?
Офлайн
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)
Отредактировано 4kpt_III (Июль 29, 2015 13:46:38)
Офлайн