From: sls Date: Mon, 6 Feb 1995 10:47:15 +0000 (+0000) Subject: Flash windows for all retreive types. Format packing results nicely. X-Git-Tag: r5_1_1~75 X-Git-Url: https://privyetmir.co.uk/gitweb.cgi?a=commitdiff_plain;h=f7f4ad5b8bb988044eeab690ba49a75a5fbcf96b;p=tkinspect Flash windows for all retreive types. Format packing results nicely. Add filtering of pack -in. --- diff --git a/lists.tcl b/lists.tcl index 8643e98..483d3e7 100644 --- a/lists.tcl +++ b/lists.tcl @@ -117,7 +117,12 @@ widget windows_list { set slot(mode) $mode } method retrieve {target window} { - $self retrieve_$slot(mode) $target $window + set result [$self retrieve_$slot(mode) $target $window] + set old_bg [send $target [list $window cget -background]] + send $target [list $window config -background #ff69b4] + send $target [list after 200 \ + [list catch [list $window config -background $old_bg]]] + return $result } method retrieve_config {target window} { set result "# window configuration of $window\n" @@ -127,25 +132,31 @@ widget windows_list { append result " \\\n\t[lindex $spec 0] [list [lindex $spec 4]]" } append result "\n" - set old_bg [send $target [list $window cget -background]] - send $target [list $window config -background #ff69b4] - send $target [list after 200 \ - [list catch [list $window config -background $old_bg]]] return $result } + method format_packing_info {result_var window info} { + upvar $result_var result + append result "pack configure $window" + set len [llength $info] + for {set i 0} {$i < $len} {incr i 2} { + append result " \\\n\t[lindex $info $i] [lindex $info [expr $i+1]]" + } + append result "\n" + } method retrieve_packing {target window} { set result "# packing info for $window\n" if [catch {send $target pack info $window} info] { append result "# $info\n" } else { - append result "pack $window $info\n" + $self format_packing_info result $window $info } return $result } method retrieve_slavepacking {target window} { set result "# packing info for slaves of $window\n" foreach slave [send $target pack slaves $window] { - append result "pack $window [send $target pack info $slave]\n" + $self format_packing_info result $slave \ + [send $target pack info $slave] } return $result } @@ -177,6 +188,10 @@ widget windows_list { regsub -all "(\n)\[ \t\]*-class\[ \t\]+\[^ \\\n\]*\n?" $value \ "\\1" value } + if [$slot(main) cget -filter_window_pack_in] { + regsub -all "(\n)\[ \t\]*-in\[ \t\]+\[^ \\\n\]*\n?" $value \ + "\\1" value + } return $value } }