Bwidget Source Code
View Ticket
Not logged in
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: 0aef8563029ab108c35320ff7230f73f25c612d7
Title: Tcl 8.5 math functions prevent backward compatibility
Type: Bug Version: 1.9.9
Submitter: anonymous Created on: 2015-12-08 17:39:48
Subsystem: bwidget 1.x Assigned To: oehhar
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2015-12-08 18:31:32
Resolution: Fixed Closed By: oehhar
    Closed on: 2015-12-08 18:31:32
ListBox failed under Tcl8.4 with "unknown math function min" error message after a BWidget package update. Found usage of functions min() and max() in expressions in listbox.tcl. I did not check any other files.
User Comments: oehhar added on 2015-12-08 18:31:32:

  • Fixed in commit [b765b56d04].
  • Tested by Stefan (reporter).
  • Ticket closed.

oehhar added on 2015-12-08 17:55:53:

Correct. Could you try the following patch:

--- C:/Users/oehhar/AppData/Local/Temp/listbox.tcl-revBASE.svn000.tmp.tcl	Thu Oct 17 08:14:34 2013
+++ C:/oehhar/elmicron/projekte/el1001/elmilog.vfs/ilib/bwidget/listbox.tcl	Tue Dec 08 18:53:49 2015
@@ -1130,17 +1130,17 @@
     foreach item $data(selitems) {
         set bbox [$path.c bbox "n:$item"]
         if { [llength $bbox] } {
             set imgbox [$path.c bbox i:$item]
             lassign $bbox x0 y0 x1 y1;
             if {[string compare "" $imgbox]} {
-                # image may exist and may be heigher than text!
+                # image may exist and may be higher than text!
                 lassign $imgbox ix0 iy0 ix1 iy1;
-                set bbox [list $x0 [expr {min($iy0,$y0)}] $x1 [expr {max($iy1,$y1)}]];
+                set bbox [list $x0 [expr {$iy0<$y0?$iy0:$y0}] $x1 [expr {$iy1>$y1?$iy1:$y1}]];
             } else {
                 set bbox [list $x0 [lindex $bbox 1] $x1 [lindex $bbox 3]]
 	    if { $selfill && !$multi } {
 		# With -selectfill, make box occupy full width of widget
 		set bbox [list 0 [lindex $bbox 1] $width [lindex $bbox 3]]