This subcommand returns or sets platform specific attributes associated with a window. The first form returns a list of the platform specific flags and their values. The second form returns the value for the specific option. The third form sets one or more of the values. The values are as follows:
This command exists since Tk 8.4 and sets or retrieves window-specific attributes. The supported attributes are different for each platform. On Tk 8.5, they are:
bll 2016-4-22: As of 2016-4-22, -fullscreen on Mac OS X must be preceded by wm withdraw . and followed by wm deiconify ..
NOTE: Support for all of these attributes depends on the system window manager; most do support, but not all.
Most options take a true/false value
Example retrieving the default values:
if 0 { % wm attributes . -disabled 0 -toolwindow 0 -topmost 0 }
RS confirms that this applies to Windows 2000 too.
KPV a toolwindow window differs from a transient window in that the transient window still has the system menu and a transient window is always above its master window (at least for W2K).
RS 2005-05-31: Recent Tk (see Changes in Tcl/Tk 8.4.8) on Windows XP have an -alpha attribute that controls, between 0.0 (invisible, fully transparent) and 1.0 (regular, fully opaque), how opaque a window is. Here's a little testing script that is quite fascinating to watch:
package require Tk pack [label .l -text "Hello, world" -font {Times 36}] update while 1 { for {set a 1.} {$a>0.} {set a [expr $a-0.01]} { wm attrib . -alpha $a; update; after 100 } for {set a 0.} {$a<1.} {set a [expr $a+0.01]} { wm attrib . -alpha $a; update; after 100 } }
MG puts out some thoughts (although ramblings is probably more accurate) on May 31 2005 (which probably apply only to MS Windows, and not MacOS/*nix). The -toolwindow option (and the wm overrideredirect command, which although not part of wm attributes is along the same lines) both remove the window's icon from the taskbar - is that unavoidable (ie, part of the same piece of OS code that does the rest of the functionality), or is it just done that way in Tk? If the latter, would it be possible to remove that, and make it another option for wm attributes? It would be good if you could remove the WM decorations, or get a "toolwindow", but still keep the window on the task bar (both so it doesn't get "lost" under other windows and become difficult to select again, and so you can have a main window that's just slightly more slimline, without full WM decorations).
AF Says the toolwindow display style is controlled by Windows, Tk only sets its window class.
Alex Collins There's a bug in certain versions of windows (2000?) that mean is you mix -toolwindow with a wm title, you cannot control the geometry correctly. aricb For best results, you should report this bug at SourceForge [L3 ].
AMG: See Transparent Toplevel for help on using -alpha to make a transparent toplevel window. See Strange Phenomen for discussion of transparent windows going opaque due to the event loop being blocked for too long.