Re: Add images recursively to tablelist cells?
- From: Kevin Walzer <sw@xxxxxxxxxxxxxxxxxxxxx>
- Date: Wed, 30 Nov 2005 02:34:38 -0500
slebetman@xxxxxxxxx wrote:
Kevin Walzer wrote:I'm trying to add images to all cells in a particular column of the tablelist widget. However, I'm not grokking how to do this.
This is my example code:
foreach row 0 { $tbl cellconfigure 0,$row -image folder }
'Walk' through your code:
foreach row 0 { # You are saying for each value in the list, and your list only one value, # and that value is 0, assign that value to the variable row. $tbl cellconfigure 0,$row -image folder # Cellconfigure the table at column 0 and at specified row to the image of a folder. # Remember now that your list only has a single value and that is zero so only # cell 0,0 will be configured. } # End of foreach. Since your list only has a single value the foreach will only # iterate once (for the value 0). The foreach loop now terminates.
What you should have done is: set rows [list 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15] foreach row $rows { ...
What you probably should be doing is: for {set row 0} {$row < $max_row} {incr row} { ...
The idea is that this snippet will iterate through each cell of column 0 and append the image. But it adds only one folder, to the top cell.
That's not recursive now is it? It's iterative.
That helped, thanks.
-- Cheers,
Kevin Walzer, PhD WordTech Software - "Tame the Terminal" http://www.wordtech-software.com sw at wordtech-software.com .
- References:
- Add images recursively to tablelist cells?
- From: Kevin Walzer
- Re: Add images recursively to tablelist cells?
- From: slebetman@xxxxxxxxx
- Add images recursively to tablelist cells?
- Prev by Date: Localisation of Tcl/Tk Application
- Next by Date: Re: Little doubts with Snit
- Previous by thread: Re: Add images recursively to tablelist cells?
- Next by thread: tcl, cell simulator, and simos
- Index(es):
Relevant Pages
|