From: Lyle Johnson Date: 2003-02-28T05:41:13+09:00 Subject: Re: FXRuby FXTable columnwidth by content? Matthias Wieding-Drewes wrote: > The question is short. Is there a good way to set the column width of a > FXTable object relative to its content? No, there is no way to *automatically* resize a column based on the width of the "widest" item's content width. The code that does the resizing would look something like this: def resizeColumn(col) maxWidth = 0 0.upto(numRows - 1) { |row| itemWidth = getItem(row, col).getWidth(self) maxWidth = (itemWidth > maxWidth) ? itemWidth : maxWidth } setColumnWidth(col, maxWidth) end If you are interested in this being added to FXTable, be sure to request it from Jeroen (FOX's author). Hope this helps, Lyle