From: Lyle Johnson Date: 2002-12-11T05:14:35+09:00 Subject: Re: FXRuby : Setting Default Height/Width in an FXList Jason Persampieri wrote: > I'm attempting to create a vertical, single-column > list of text items to match up with a vertical > single-column FXHeader. Is there any way to change > the height of individual items within a list? By default, the height of a list item is determined by the greater of the height of its font or the height of its icon, plus some extra inter-item padding, i.e. class FXListItem def getHeight(aList) textHeight = 0 iconHeight = 0 unless text.empty? textHeight = aList.font.fontHeight end unless icon.nil? iconHeight = icon.height end LINE_SPACING + [textHeight, iconHeight].max end end So if you want to fix the list items' height at some particular value, one way would be to subclass FXListItem and override the getHeight() method: class FixedHeightListItem < FXListItem def initialize(theHeight, theText, theIcon=nil, theData=nil) super(theText, theIcon, theData) @myFixedHeight = theFixedHeight end def getHeight(aList) @myFixedHeight end end And then to add items of this class to your list: myList = FXList.new(...) myList.appendItem(FixedHeightListItem.new(20, "Tall Item")) myList.appendItem(FixedHeightListItem.new(50, "Really Tall Item")) Hope this helps, Lyle