Skip to content Skip to sidebar Skip to footer

What Protocols Of Tkinter Toplevel Widget Are There

When using Tk.protocol arguments could be “WM_DELETE_WINDOW”, “WM_SAVE_YOURSELF” and “WM_TAKE_FOCUS” But is there any else. Concretely, in my program, I want to create

Solution 1:

Here is the answer you are looking for :

Q. Is there a way of getting a list of available protocols for wm protocol? The man pages only list the obvious / common ones (WM_DELETE_WINDOW, WM_SAVE_YOURSELF, and WM_TAKE_FOCUS).

A. Those are the only three defined by the ICCCM; the freedesktop.org [EWMH] spec also defines _NET_WM_PING.

Note that WM_SAVE_YOURSELF is deprecated, and Tk apps can't implement WM_TAKE_FOCUS or _NET_WM_PING correctly, so WM_DELETE_WINDOW is the only one that should be used.

DKF: Tk now handles _NET_WM_PING for you by itself in the correct way; you'll never see this one at the script level. (The purpose of the protocol is to let other clients — especially a window manager or session manager — determine positively whether the application is processing events. That puts its implementation correctly buried in the guts of Tk.)

Source : https://wiki.tcl.tk/8454

Post a Comment for "What Protocols Of Tkinter Toplevel Widget Are There"