Am 26.04.2018 um 14:49 schrieb Busirane:
Modify your test script to become:
proc fill {t} {
if {$::gotConfigureEvent} {
set ::gotConfigureEvent 0
after 1000 [list fill $t]
return
}
set data [list [list [winfo geometry $t]] {"row 2"} {"etc..."}]
$t delete 0 end
$t insertlist end $data
$t insertchildlist root end $data ;# problem 1
}
puts [package require tablelist]
tablelist::tablelist .t -columns {0 data}
pack .t -fill both -expand 1
set gotConfigureEvent 0
fill .t
bind .t <Configure> {+ set gotConfigureEvent 1; fill .t} ;# problem 2
This will solve problem 2, which is present on all platforms and is
related to the fact that the insertlist invocation interferes badly with
some internal tablelist actions triggered by the <Configure> event.
Problem 1 is Windows-specific, it doesn't occur in other environments
(at least not on X11). It is caused by unexpected <Configure> events,
generated when embedded windows within a text widget are destroyed. I
have not yet found a solution to this strange Windows behavior. The
above changes in your code at least alleviate the problem to some
extent, making it possible for the user to resize the window if he or
she releases the mouse button within a few seconds.
Answer to Q1: I hope there is a way, but I haven't found it yet. :-(
Answer to Q2: data(rowsToDisplay) is definitely not the current height
in rows. Instead, you can retrieve it as foolows:
set topRow [$t index top]
set btmRow [$t index bottom]
set heightInRows [$t viewablerowcount $topRow $btmRow]
Note that the viewablerowcount subcommand was introduced in Tablelist 5.10.
--
Csaba Nemethi
http://www.nemethi.de mailto:
csaba....@t-online.de