1 # wingrab.tcl -- grab support for Windows.
2 # Copyright (C) 1997 Cygnus Solutions.
3 # Written by Ian Lance Taylor <ian@cygnus.com>.
5 # Disable a list of windows.
7 proc WINGRAB_disable { args } {
9 ide_grab_support_disable [wm frame $w]
13 # Disable all top level windows, other than the argument, which are
14 # children of `.'. Note that if you do this, and then destroy the
15 # frame of the only enabled window, your application will lose the
16 # input focus to some other application. Make sure that you reenable
17 # the windows before calling wm transient or wm withdraw or destroy on
18 # the only enabled window.
20 proc WINGRAB_disable_except { window } {
21 foreach w [winfo children .] {
22 if {$w != $window} then {
23 ide_grab_support_disable [wm frame [winfo toplevel $w]]
28 # Enable a list of windows.
30 proc WINGRAB_enable { args } {
32 ide_grab_support_enable [wm frame $w]
36 # Enable all top level windows which are children of `.'.
38 proc WINGRAB_enable_all {} {
39 foreach w [winfo children .] {
40 ide_grab_support_enable [wm frame [winfo toplevel $w]]
44 # The basic routine. All commands are subcommands of this.
46 proc ide_grab_support {dispatch args} {
49 if {[info commands WINGRAB_$dispatch] == ""} then {
50 error "unrecognized key \"$dispatch\""
53 # We only need to do stuff on Windows.
54 if {$tcl_platform(platform) != "windows"} then {
58 eval WINGRAB_$dispatch $args