File: tktable.tcl

package info (click to toggle)
tclodbc 2.5-5
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 984 kB
  • ctags: 417
  • sloc: sh: 3,764; cpp: 2,035; tcl: 591; makefile: 250
file content (37 lines) | stat: -rw-r--r-- 938 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
####################################################################
#
# tktable.tcl
#
# View data in a table in tktable widget. 
# 
# Uses utility procedures TkTableInit TkTableRead in utilproc.tcl
#
# This file should be executed in wish shell, having tktable widget 
# installed
#

# Create the db, if not yet created.
set dir [file dirname [info script]]
source $dir/createdb.tcl

# Populate some data to tables
if {[db "select count(*) from table1"] == 0} {source $dir/populate.tcl}

####################################################################
#
# Execution starts here
#

package require Tktable
table .t -variable t -yscrollcommand {.scroll set} -height 10
scrollbar .scroll -command {.t yview}
pack .t .scroll -side left -fill y

wm resizable . 0 1

db statement stmt "select * from Table1 where IntData < 100"
stmt execute

tclodbc::TkTableInit .t stmt
tclodbc::TkTableRead .t stmt