Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Swap/Browse thru a generated list (with buttons) 1

Status
Not open for further replies.

vignette1

Programmer
Jan 23, 2004
7
0
0
CH
[morning]
Hi

I'm looking for a solution to browse thru a generated
list. I get the list from a sql-statement and want to
show the first 30 or 50 rows. With "back" and "forward"
buttons I will get the next 30 or 50 rows.

For example: Google 1 2 3 4 5 next

Is this possible in tcl?

Thanks!

Thomas

 
Use the
Code:
-listvariable
option of the listbox and manage to put the desired range in the list:
Code:
  set ::huge_list ...
  listbox .lb -listvariable ::tiny_list
  proc setrange {n}   {
    set start [expr {$n * 50}]
    set end [expr {($n + 1) * 50 - 1}]
    set ::tiny_list [lrange $::huge_list $start $end]
  }
  setrange 0

If you want a virtual listbox that can handle huge lists:

HTH

ulis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top