What I don't want is to duplicate the data (read: copy each vector's
data into a list variable and use a listbox for each vector, for
example). I'm looking for something similar to hugelist [1] or
virtuallist [2] but tuned specifically for BLT vectors.
Does anyone know of such a beast?
[1] http://wiki.tcl.tk/6784
[2] http://wiki.tcl.tk/10035
Thanks.
--
Bryan Oakley
http://www.tclscripting.com
The solution was pretty simple. I just wrote my own custom
scrollbar-handling code and tied it to a tablelist widget. Admittedly it
took half a day or so to get it right but in the end it's only 60 lines
of code or so, and I could probably cut that in half if I had the time.
The idea is to take the scrollbar values (two numbers between 0.0 and
1.0) and use those to compute the range of elements in the vector(s) to
be displayed. Using features from the tablelist, I'm able to grab the
data with [$vector range $top $bottom] and just drop it in the tablelist
one column at a time. And, of course, as I add data to the vectors I
have to update the scrollbars so they are relative to the total amount
of data available.
As an aside, this is the second time in about as many years that I've
had a need to use BLT, and I'm again reminded of just how powerful the
BLT graph and vector functionality is. If you've not used it before, I
don't think it's an understatement to say that it does way more than you
might imagine it does.
> The idea is to take the scrollbar values (two numbers between 0.0 and
> 1.0) and use those to compute the range of elements in the vector(s) to
> be displayed. Using features from the tablelist, I'm able to grab the
> data with [$vector range $top $bottom] and just drop it in the tablelist
> one column at a time. And, of course, as I add data to the vectors I
> have to update the scrollbars so they are relative to the total amount
> of data available.
>
> As an aside, this is the second time in about as many years that I've
> had a need to use BLT, and I'm again reminded of just how powerful the
> BLT graph and vector functionality is. If you've not used it before, I
> don't think it's an understatement to say that it does way more than you
> might imagine it does.
>
I'll have to second that, it is very simple to do some very nice things,
incredibly powerful & *fast*
Bruce
rene
As a matter of fact, yes!
I was in high-praise mode just this morning while talking to a
co-worker, marveling about the foresight JO had in designing Tk. His
designs have really stood the test of time.
To be able to take vectors from BLT, a megawidget for displaying tables
of information, and a stock scrollbar, and make them all work together
seamlessly (with zero performance problems) is a testament to good
design by all those involved.
> Nobody had a reply, but for those who may stumble onto this thread in
> the future...
I am not used to write (anymore) in newsgroups, and I thought the
answer was obvious.
Am I the only one to play with Tktable? Using Tktable with -command is
exactly what you want.
I use it everyday with SQLite, displaying queries of approx. 25000
rows. in less than a second.
--
-eric
I've toyed with tktable, but in all the years I've done Tk programming
I've only once or twice ever needed to display tables of data so it's
not part of my normal toolchest.
We don't use tktable in our product so I wouldn't have considered it
unless it was the only solution. Fortunately I've proven it isn't. My
ultimate solution required only about 80 lines of code in its currently
un-optimized state.
Thanks anyway!