home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.tcl,bnr.lang.tcl
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!nott!bnrgate!bcars6a8!bnr.ca!norm
- From: norm@bnr.ca (Norm MacNeil)
- Subject: Dual box scrolling
- Message-ID: <1993Jan11.192403.28728@bcars6a8.bnr.ca>
- Sender: usenet@bcars6a8.bnr.ca (Use Net)
- Nntp-Posting-Host: bcarh1ff
- Reply-To: norm@bnr.ca
- Organization: Bell-Northern Research Ltd.
- Date: Mon, 11 Jan 1993 19:24:03 GMT
- Lines: 45
-
- I remember someone posting about how to allow for dual-box scrolling; e.g.,
- with spreadsheets, you can "lock" a row or column to remain in place while
- you scroll around. I did the same for a scrolling "header" basically by
-
- ---
- frame .frame
- scrollbar .frame.listbox.ysb -command ".frame.listbox.box yview"
- scrollbar .frame.listbox.xsb -orient horizontal -command "dualajust"
- listbox .frame.listbox.hdr -geometry 40x2 -xscrollcommand \
- ".frame.listbox.xsb set"
- listbox .frame.listbox.box -yscrollcommand ".frame.listbox.ysb set" \
- -xscrollcommand ".frame.listbox.xsb set"
- pack append .frame \
- .frame.listbox.xsb {bottom fillx} \
- .frame.listbox.ysb {left filly} \
- .frame.listbox.hdr {expand fill} \
- .frame.listbox.box {expand fill}
-
- proc dualajust {n} {
- global .frame.listbox.hdr .frame.listbox.box
- .frame.listbox.hdr xview $n
- .frame.listbox.box xview $n
- }
-
- ---
-
- The only problem I have is that I have to have this extra procedure to scroll
- both areas. Is there a "variable" like in bind to substitute in the value that
- is passed to "dualadjust"; e.g.,
-
- scrollbar .frame.listbox.xsb -orient horizontal \
- -command ".frame.listbox.hdr xview %x; .frame.listbox.box xview %x"
-
- or some such beast.
-
- Any thoughts?
-
- Thanks,
- Norm.
-
- +-----------------------------------------------------------------------+
- Norm MacNeil Phone: (613) 763-3372
- Data Systems Fax: (613) 765-2854
- Bell-Northern Research Ltd. EMail: norm@bnr.ca (INTERNET)
- #include <disclaimer.std> "Roller bladers do it in-line!"
-