'''wm attributes''' ''window'' '''wm attributes''' ''window'' ?'''option'''? '''wm attributes''' ''window'' ?'''option value option value...'''? 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: On Windows, '''-disabled''' gets or sets whether the window is in a disabled state. '''-toolwindow''' gets or sets the style of the window to toolwindow (as defined in the MSDN). '''-topmost''' gets or sets whether this is a topmost window (displays above all other windows). On Macintosh, On Unix, there are currently no special attribute values. ---- This command exists since Tk 8.4 and sets or retrieves window-specific attributes. The command is different for each platform. I know the possible options for Windows98 and it seems there are no options to this command with Linux. '''Windows (98) options''': All options take a true/false value '''-toolwindow''' makes a window with a single close-button (which is smaller than usual) on the right of the title bar '''-topmost''' makes sure the window always stays on top of all other windows '''-disabled''' makes it impossible to interact with the window and redraws the focus Example retrieving the default values: if 0 { % wm attributes . -disabled 0 -toolwindow 0 -topmost 0 } [RS] confirms that this applies to Windows 2000 too. [Peter Lewerin] WinXP 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 conttol the geometry correctly. [aricb] For best results, you should report this bug at SourceForge [http://sourceforge.net/tracker/?atid=112997&group_id=12997&func=browse]. ---- See also: * [wm] ---- [Tk syntax help] - [Category Command] - [Category GUI] - [GSoC2007 Tcl/Tk Application] - [Category Introspection]