/usr/share/tkrat2.2/util/rat_ed.tcl is in tkrat 1:2.2cvs20100105-true-dfsg-6ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 | # rat_ed.tcl --
#
# This file contains the code which implements the enabledisable command
#
#
# TkRat software and its included text is Copyright 1996-2004 by
# Martin Forssén
#
# The full text of the legal notice is contained in the file called
# COPYRIGHT, included with this distribution.
package provide rat_ed 1.0
namespace eval rat_ed {
namespace export enabledisable enable disable
variable disabledFg #a3a3a3
variable enabledFg Black
}
# rat_ed::enabledisable --
#
# Enables or disables all widgets under the given one
#
# Arguments:
# ed - true if we should enable
# w - name of the parent widget
proc rat_ed::enabledisable {ed wins} {
variable disabledFg
variable enabledFg
if {$ed} {
set state normal
set fg $enabledFg
} else {
set state disabled
set fg $disabledFg
}
foreach w $wins {
if {[llength [winfo children $w]]} {
rat_ed::enabledisable $ed [winfo children $w]
}
if {![catch {$w cget -state}]} {
$w configure -state $state
}
catch {$w configure -foreground $fg}
}
}
# rat_ed::enable --
#
# Enables a widget
#
# Arguments:
# w - name of the widget
proc rat_ed::enable {w} {
variable enabledFg
if {![catch {$w cget -state}]} {
$w configure -state normal
}
if {"" != [option get . *foreground Color]} {
set enabledFg [option get . *foreground Color]
}
$w configure -foreground $enabledFg
}
# rat_ed::disable --
#
# Disables a widget
#
# Arguments:
# w - name of the widget
proc rat_ed::disable {w} {
variable disabledFg
if {![catch {$w cget -state}]} {
$w configure -state disabled
}
if {"" != [option get . *disabledForeground Color]} {
set disabledFg [option get . *disablednabledForeground Color]
}
$w configure -foreground $disabledFg
}
|