${1$@} package require Tk panedwindow .p -orient..." /> ${1$@} package require Tk panedwindow .p -orient..." />

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[TCL] PanedWindow
07-23-2010, 11:39 AM
Post: #1
[TCL] PanedWindow
[Image: 70862_screenshot8.png]
Code:
#!/bin/sh
# -*- tcl -*-
# The next line is executed by /bin/sh, but not tcl \
exec wish "$0" ${1+"$@"}

package require Tk

panedwindow .p -orient vertical -showhandle 1
pack .p -expand yes -fill both

foreach {w label} {code "Code:" notes "Notes:"} {
   set f [labelframe .p.$w -text $label]
   text $f.t -height 10 -width 40 \
      -wrap none -font {courier 12} \
      -xscrollcommand [list $f.xbar set] \
      -yscrollcommand [list $f.ybar set]
   scrollbar $f.xbar -orient horizontal \
      -command [list $f.t xview]
   scrollbar $f.ybar -orient vertical \
      -command [list $f.t yview]

   grid $f.t -row 0 -column 0 -sticky news -padx 2 -pady 2
   grid $f.ybar -row 0 -column 1 -sticky ns -padx 2 -pady 2
   grid $f.xbar -row 1 -column 0 -sticky ew -padx 2 -pady 2
   grid columnconfigure $f 0 -weight 1
   grid rowconfigure $f 0 -weight 1


   .p add $f -minsize 1i -padx 4 -pady 6
}

"Character is determined more by the lack of certain experiences than by those one has had."
Friedrich Nietzsche
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


 Quick Theme: