Tk Library Source Code

View Ticket
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.
Ticket UUID: 2499978
Title: Infinite bug on widget::scrolledwindow
Type: Bug Version: None
Submitter: ofv Created on: 2009-01-11 20:28:21
Subsystem: tklib Assigned To: hobbs
Priority: 5 Medium Severity:
Status: Open Last Modified: 2009-02-06 05:58:53
Resolution: None Closed By:
    Closed on:
Description:
On a dialog that contains a ttk::treeview  as the widget of a scrolledwindow, when the treeview has certain items, this errors happens:

too many nested evaluations (infinite loop?)
    (procedure "::snit::RT.CallInstance" line 5)
    invoked from within
"::snit::RT.CallInstance ::widget::scrolledwindow::Snit_inst1 _set_scroll hsb 0 0.00555556"
too many nested evaluations (infinite loop?)
    (procedure "::snit::RT.CallInstance" line 1)
    invoked from within
"::snit::RT.CallInstance ::widget::scrolledwindow::Snit_inst1 _set_scroll vsb 0 0.00403226"
too many nested evaluations (infinite loop?)
    (procedure "Tree::_update_scrollregion" line 42)
    invoked from within
"Tree::_update_scrollregion .i_form_1.sw.i_frame.frame.lf_2.sw.tree"
    (command bound to event)
too many nested evaluations (infinite loop?)
    (procedure "::snit::RT.CallInstance" line 42)
    invoked from within

(this repeats several times).

Unneded horizontal and vertical scrollbars are displayed too.

The problem goes away with this patch:

Index: scrollw.tcl
===================================================================
--- scrollw.tcl(revision 333)
+++ scrollw.tcl(working copy)
@@ -183,7 +183,7 @@
 if {!$realized} { return }
 # This is only called if the scrollbar is attached properly
 upvar 0 $varname sb
-if {$sb(auto)} {
+if {$sb(auto) && !$sb(lock)} {
     if {!$sb(lock)} {
 # One last check to avoid loops when not locked
 if {$vmin == $sb(lastmin) && $vmax == $sb(lastmax)} {

(I didn't remove the second if, which is now redundant, for making clear the ciritical change).
User Comments: ofv added on 2009-01-12 03:37:57:
Forgot to add that the problem is present only on Windows XP. Not Linux, not Win2K.