From: Lyle Johnson Date: 2002-12-10T01:30:10+09:00 Subject: Re: Update on Quest for Multi-Column Listbox in FXRuby CRIBBSJ wrote: > The other approach I am going to try tonight is to use an FXIconList > (recommended by Lyle). But the only example I can find is using a > FXFileList, which is a descendant of FXIconList. The only problem is that > because it is hard-coded to be used listing a directory, it doesn't show any > of the initialization arguments that would be used with FXIconList. Anyone > have an example of using FXIconList that they could share? Jamey, Sorry for the delay in getting back to you. If you're looking for the FOX equivalent of Gtk's CList widget I'm pretty sure you want the FXIconList. An icon list can be displayed in several different modes, but the one you'd want is the "details" mode which presents the list items in a traditional vertical arrangement. To construct this kind of icon list pass in the ICONLIST_DETAILED option, e.g. iconList = FXIconList.new(contents, nil, 0, ICONLIST_DETAILED|LAYOUT_FILL_X|LAYOUT_FILL_Y) An FXIconList has a built-in FXHeader widget that is displayed when the list is configured in details mode. To set up the header captions, use the FXIconList#addHeader method, e.g. iconList.appendHeader("Name", nil, 50) iconList.appendHeader("Rank", nil, 100) iconList.appendHeader("Serial Number", nil, 150) Finally, to add list items use the FXIconList#appendItem method: iconList.appendItem("Gomer Pyle\tSergeant\t12345") Note the use of tabs ("\t") to separate the fields in a list item. When the user clicks on a list item it will generate a SEL_COMMAND message; to catch that you could do something like this: iconList.connect(SEL_COMMAND) do |sender, sel, current| puts "user selects item #{current}" end Hope this helps, Lyle