Tk Library Source Code

View Ticket
Login
Ticket UUID: 833034
Title: ScrolledWindow fails after managed widget is destroyed
Type: Bug Version: None
Submitter: schroedter Created on: 2003-10-30 13:10:09
Subsystem: bwidget Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Closed Last Modified: 2003-10-31 00:43:25
Resolution: Fixed Closed By: hobbs
    Closed on: 2003-10-30 17:43:25
Description:
ScrolledWindow should be more robust, when the managed
widget is destroyed, like it was for BWidget 1.5.

Application background:
-----------------------
(1) After creating a ScrolledWindows $sw it has no
widget and displays a gray background.
(2) After assigning a widget [$sw setwidget $w] it
manages the widget $w.
(3) With 1.6 's not possible anymore to return to state
(1).

With BWidget 1.5 it was possible to destroy the widget $w.
But BWidget 1.6 fails to display anything even after a
fresh     
[$sw setwidget ...].

It would also be nice to have a
    $sw setwidget {}
making the ScrolledWindow $sw manage no widget.

Script illustrating the problem
(runs with 1.5, fails with 1.6):
-----------------------------
catch {console show}
package require -exact BWidget 1.6

set sw [ScrolledWindow .sw -scrollbar both -auto both]
pack $sw -fill both -expand yes
wm geometry . 400x600

for {set i 0} {$i < 2} {incr i} {
    text .text$i
    .text$i insert end [string repeat "This is text
window $i\n" 5]
}

puts "The ScrolledWindow has no widget"
after 3000 {$sw setwidget .text0; puts "Set widget 0"}
after 6000 {destroy .text0; puts "Destroy widget 0"}
after 9000 {$sw setwidget .text1; puts "Set widget 1"}
User Comments: hobbs added on 2003-10-31 00:43:25:
Logged In: YES 
user_id=72656

fixed 10/30.