From f04acb63829679502c3e8c992f1bbaeaf4637e69 Mon Sep 17 00:00:00 2001 From: Pat Thoyts Date: Sat, 28 Nov 2020 13:01:08 +0000 Subject: [PATCH] windows_list: test for -background to avoid setting error in remote --- windows_list.tcl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/windows_list.tcl b/windows_list.tcl index 800d7bf..092f988 100644 --- a/windows_list.tcl +++ b/windows_list.tcl @@ -75,12 +75,13 @@ widget windows_list { } method retrieve {target window} { set result [$self retrieve_$slot(mode) $target $window] - if {[catch { + set hasbg [lsearch -exact -index 0 [send $target [list $window configure]] -background] + if {$hasbg != -1} { set old_bg [send $target [list $window cget -background]] send $target [list $window configure -background #ff69b4] send $target [list after 200 \ [list catch [list $window configure -background $old_bg]]] - }]} { + } else { # FIXME: for ttk items toggle state active? set restorestate [send $target [list $window state active]] send $target [list after 200 [list catch [list $window state $restorestate]]] -- 2.23.0