[Tcllib-bugs] [ tcllib-Bugs-1165534 ] Listbox bug, a non-stop loop cause the shaking of the widge
by SourceForge.net other posts by this author
Mar 24 2006 10:26AM messages near this date
[Tcllib-bugs] tcllib-cvs: "bwidget ChangeLog mainframe.tcl pkgIndex.tcl" modified
|
[Tcllib-bugs] [ tcllib-Bugs-1408494 ] BWidget Tree bug with autoscroll (when dragging)
Bugs item #1165534, was opened at 2005-03-17 15:18
Message generated for change (Comment added) made by dev_null42a
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112883&aid=1165534&group_id=12883
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: bwidget
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: pharmatcl (pharmatcl)
Assigned to: Damon Courtney (damonc)
Summary: Listbox bug, a non-stop loop cause the shaking of the widge
Initial Comment:
Following is a test code, please run it and your will
see a ScrolledWindow shaking.
Before you run it, please make sure that "CP: 555 *
AAA-I am shaking wildly 10mm dia: 59.5 mm" is in a
single line. The length of the list item name really
matters.
######### test code starts ######################
set bwidget_path *YOUR BWIDGET PATH HERE*
lappend auto_path $bwidget_path
package require BWidget
toplevel .shaking
set f [frame .shaking.butF]
set sw [ScrolledWindow $f.sw -auto both -relief sunken -borderwidth 2]
set marksList [ListBox $f.lb -relief flat -borderwidth 0 -padx 0 -height 8 -
width 40 -bg white]
$sw setwidget $marksList
grid $sw -row 0 -column 0 -columnspan 6 -pady 0 -padx 2m
$marksList insert end 1 -text "1"
$marksList insert end 2 -text "2"
$marksList insert end 3 -text "3"
$marksList insert end 4 -text "CP: 555 * AAA-I am
shaking wildly 10mm dia: 59.5 mm"
# make sure that "CP: 555 * AAA-I am shaking wildly
10mm dia: 59.5 mm" is a single line
$marksList insert end 5 -text "5"
$marksList insert end 6 -text "6"
$marksList insert end 7 -text "7"
$marksList insert end 8 -text "8"
pack $f
#### test code ends #################################
#### test environment ################################
If you run it by wish8.3, no problme at all,
if you run it by wish8.4, you got a shaking widget.
My testing environment:
1. Redhat Linux 2.4.21-9.ELsmp
2. BWidget-1.7.0, tcl 8.4, and tk 8.4
3. Default font
#### Code analysis ##################################
Bwidget induces an endless loop through a "bind" command.
(In Bwidget-1.7.0),
In line 105 of listbox.tcl:
bind ListBox <Configure> [list ListBox::_resize %W]
In proc ListBox::_resize, line 1139 of listbox.tcl:
it call _update_scrollregion :
} else {
if {[Widget::cget $path -selectfill]} {
_update_select_fill $path
}
_update_scrollregion $path # this line triggers
an endless loop
}
In proc ListBox::_update_scrollregion, line 918 of
listbox.tcl
it call $path.c configure -scrollregion [list 0 0 $w $h]
This triggers ListBox <Configure> event and call
_resize again, forming a loop.
If you put in "puts " commands in _resize and
_update_scrollregion
you will see _resize and _update_scrollregion called
alternatively
Removing line 1139, "_update_scrollregion $path",
dismantles the shaking.
----------------------------------------------------------------------
> Comment By: J. Tang (dev_null42a)
Date: 2006-03-24 13:25
Message:
Logged In: YES
user_id=1381097
After some analysis, it appears that too many configure and
resize events are being generated, causing Tk's event ring
buffer to overflow.[1] As an experiment, I ran the provided
test program under differing window managers; the shaking
behavior occurs when differing number of items are added to
the ListBox. I see no clean way of resolving this problem.
[1] This error was first reported as Bug 795608, "tk binding
problem in Gnome and Ximian". My analysis to comp.lang.tcl
may be found at http://tinyurl.com/l6dfd.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=112883&aid=1165534&group_id=12883
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Tcllib-bugs mailing list
Tcllib-bugs@[...].net
https://lists.sourceforge.net/lists/listinfo/tcllib-bugs
|