proc highlight_products {input {col 1}} {
746 puts "within $input \n"
747
748 for {set i 0} {$i < [$::prodTbl index end]} {incr i} {
749 if {[info exists ::originalBg($i)]} {
750 puts "originalBg exists, setting row back to original color\n"
751 $::prodTbl rowconfigure $i -background ::originalBg($i)
752 } else {
753 puts "originalBg does not exist yet, defining it now\n"
754 set ::originalBg($i) [$::prodTbl rowcget $i -background]
755 puts "ROW PROPERTY: $::originalBg($i) [$::prodTbl rowcget $i -text]\n"
756 }
757 }
758
759 for {set i 0} {$i < [$::prodTbl index end]} {incr i} {
760 puts [$::prodTbl rowcget $i -text ]
761
762 if {[lsearch $input [$::prodTbl cellcget $i,0 -text]] >= 0 } {
763 puts "SHOULD BE HIGHLIGHTING\n"
764 $::prodTbl rowconfigure $i -background yellow
765 }
766 }
767 puts "contents of originalBg\n"
768 parray ::originalBg
769 }
Hi Ben,
Everything in your script is OK, except for a missing "$" character to
be prepended to "::originalBg($i)" in line #751. Insert it, and the
script will work as expected.
It's just like in real life: No $, no success. :-)
Best regards,
Csaba
--
Csaba Nemethi http://www.nemethi.de mailto:csaba....@t-online.de
Thanks, the more tired I get, the less I seem to notice when things are
wrong :) What I'm trying to get working now is a "Total" row- I've written
a proc that tacks on a blank row plus a red-highlighted row that shows
"Total: 123.50", for example(the number being the sum of all values in
the corresponding column. Is there a cleaner way to do such a
thing? At one point, I was thinking perhaps to just stick a label in the
scrolled frame where I'm sticking the tablellist, but I realized that if
the window were realized the table and label wouldn't necessarily line
up...
> Thanks, the more tired I get, the less I seem to notice when things are
> wrong :) What I'm trying to get working now is a "Total" row- I've written
> a proc that tacks on a blank row plus a red-highlighted row that shows
> "Total: 123.50", for example(the number being the sum of all values in
> the corresponding column. Is there a cleaner way to do such a
> thing? At one point, I was thinking perhaps to just stick a label in the
> scrolled frame where I'm sticking the tablellist, but I realized that if
> the window were realized the table and label wouldn't necessarily line
> up...
I don't know of any cleaner way.