Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Tktable cell update

63 views
Skip to first unread message

Roger Oberholtzer

unread,
Jul 18, 2018, 5:34:42 AM7/18/18
to
I have a TkTable that will change the rows it contains. So I use this to delete/add the rows as needed:

$table delete rows 1 $old
$table insert rows 1 $num

I delete all but the first row, which is the unchanging column labels.

I see that the rows in the table are adjusted as expected. So far so good.

I use the -command option to have TkTable call a function to fill the cells:

-command "getCell %r %c"

This is getting called the first time I add rows. But after that, the command is not getting called. The new cells remain empty. They do not have the old values. They are empty. I tried adding this after inserting the rows:

$table reread

But that made no difference. How can I get TkTable to fill cells the rows that have been added? Am I missing some invalidate command/logic that tells that any old contents should be forgotten and the -command called again? I set the cache logic for it not to cache values, but that made no difference:

-cache 0

It is also odd that the first row (not deleted) is also empty. It is still drawn as a header (different background), but the labels are gone.

Rolf Ade

unread,
Jul 18, 2018, 7:37:42 AM7/18/18
to
Just do

$table configure -usecommand 1

after you've done after you're finished with your row delete/insert
commands.

This "manually" triggers updating the cell values via the -command
argument.
0 new messages