2 Table and 1 vertical scroll
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

2 Table and 1 vertical scroll

From: <harish.dewan@gmail.com>
Date: Fri Sep 02 2005 - 09:56:33 CEST

Hi few days back I had a query relating "2 Table and 1 vertical scroll,
I wanted to know if this is possible in tcl/tk"

Thanks for your reply.
As per your suggestions I tried that and I am able to do that, but I
have a problem in it.
I think it is due to pack command, not getting what actually problem is
1) In GUI, table1 is big and table 2 is small. I have set the width
also then also there is no change in GUI.
2) if I click on scrollbar it gives error and if I click at any other
place in scrollbar , it scrolls

#The code is as follows
package require Tktable

frame .ss
frame .ss.time

#this frame will contain only x scroll and a table
frame .ss.time.left -width 10

#this frame will contain x and y scroll and a table
frame .ss.time.right -width 10

proc scroller {W1 W2 v1 v2 v3} {
  $W1 yview $v1 $v2 $v3
  $W2 yview $v1 $v2 $v3
}

scrollbar .ss.time.left.xscroll1 -orient horiz -command
".ss.time.left.cleft xview"
scrollbar .ss.time.right.xscroll -orient horiz -command
".ss.time.right.cright xview"

scrollbar .ss.time.right.yscroll -command { scroller
.ss.time.left.cleft .ss.time.right.cright }

table .ss.time.left.cleft -rows 512 -cols 522 -variable
mta_entry_array -colwidth 2 \
  -titlerows 1 -titlecols 1 -font { Arial 8 } -multiline false \
  -xscrollcommand ".ss.time.left.xscroll1 set " -yscrollcommand "
.ss.time.right.yscroll set"

table .ss.time.right.cright -rows 512 -cols 522 -variable
mta_entry_array -colwidth 2 \
  -titlerows 1 -titlecols 1 -font { Arial 8 } -multiline false \
  -xscrollcommand ".ss.time.right.xscroll set " -yscrollcommand "
.ss.time.right.yscroll set"

pack .ss.time.left.xscroll1 -side bottom -fill x
pack .ss.time.right.xscroll -side bottom -fill x

pack .ss.time.right.yscroll -side right -fill y
pack .ss.time.left.cleft -expand true -fill both -side left
pack .ss.time.right.cright -expand true -fill both -side right

pack .ss.time.left -side left -fill both -expand true
pack .ss.time.right -side right -fill both -expand true
pack .ss.time
pack .ss

Waiting for your reply and thanks in advance

Regards
Harish.
Received on Thu Sep 29 14:34:39 2005