From: Jim Menard Date: 2001-08-16T22:55:10+09:00 Subject: [ruby-talk:19898] TkListbox.bbox() bug? I've run into a mystery. I create a TkListbox and fill it with items. They display correctly. When I call list.bbox(i) to retrieve the bounding box of item i, there is a problem. Only the 0'th item returns the bounding box. All others return an empty string. I've tested the Tk logic by creating a similar list using the "wish" shell, and the bounding boxes are returned as I expect, for all values in the list. The Tk docs say that bbox will return an empty string if the whole list element is not visible, but this is not the case. Is this a bug? Here's some Ruby code that will reproduce the problem. #! /usr/bin/env ruby require 'tk' root = TkRoot.new() list = TkListbox.new(root) list.pack(:side=>'left', :fill=>'both') 5.times { | i | list.insert('end', "Item number #{i - 1}") } # Only the 0'th item prints a bounding box; the rest are empty strings 5.times { | i | p list.bbox(i) } Here's some Tk code that's almost equivalent (I don't know TCL). It prints the boxes for all elements. listbox .list pack .list -side left -fill both .list insert end "Item number 0" .list insert end "Item number 1" .list insert end "Item number 2" .list insert end "Item number 3" .list insert end "Item number 4" .list bbox 0 .list bbox 1 .list bbox 2 .list bbox 3 .list bbox 4 Jim -- Jim Menard, jimm@io.com, http://www.io.com/~jimm/ "The reason why there is no good commercial Java develoment environment is that the only folks that are good enough to write one all use EMACS." -- Unknown, on comp.lang.java.programmer