Tk Library Source Code

Artifact [3000b50838]
Login

Artifact 3000b50838f085a0d91bc6ee875883f38718c928:

Attachment "panedWindow.tcl" to ticket [613134ffff] added by nobody 2002-09-23 17:08:47.
# this code produces wrong results on Win NT 4.0 Service Pack 5
# TCL/TK and 8.3.2, 8.3.4 and 8.4.0 with BWidget 1.4.1

proc scrolledtext { w args } {
    set frameW [format "%s_frame" $w]
    set sxW [format "%s_sx" $w]
    set syW [format "%s_sy" $w]
        
    frame $frameW
    eval text $w -xscrollcommand \"$sxW set\"  -yscrollcommand \"$syW set\" [join $args]
    scrollbar $sxW -orient horizontal -command "$w xview"
    scrollbar $syW -orient vertical -command "$w yview"

    pack $sxW -in $frameW -side bottom -expand 0 -fill x -anchor sw
    pack $syW -in $frameW -side right -expand 0 -fill y -anchor ne
    pack $w -in $frameW -side top -fill both -expand 1 -anchor nw
    pack $frameW -side top -fill both -expand 1 -anchor nw
}

# with 1.4.1 does not display second pane correctly - needs resizing
# of window
package require -exact BWidget 1.4.1

# with 1.3.1 everything is ok
#package require -exact BWidget 1.3.1

PanedWindow .pw -side top
pack .pw -side top -expand yes -fill both -anchor nw


set pane [.pw add]

ScrolledWindow $pane.sw -auto none
text $pane.sw.t 
$pane.sw setwidget $pane.sw.t
pack $pane.sw.t -side top -expand yes -fill both -anchor nw
pack $pane.sw -side top -expand yes -fill both -anchor nw

$pane.sw.t insert end "new"

set pane [.pw add]
scrolledtext $pane.t 
pack $pane.t -side top -expand yes -fill both -anchor nw

$pane.t insert end "traditional"