From: Lyle Johnson Date: 2003-02-11T15:37:45+09:00 Subject: Re: Does FX/Ruby have some standard icons? Harry Ohlsen wrote: > I'm trying to be vaguely clever, by only expanding tree items when > someone double clicks on them, thus improving perceived performance (in > terms of startup time). > > However, I'd like the user to know whether an item has children. Ie, > whether it makes sense to double click on an item. > > Hence, I'd like to put two different icons next to the tree nodes, > depending upon whether they have children in the data. FOX won't know > about the children yet, since they won't be added to the tree list until > the double click, so it doesn't display a "+" sign. You are talking about two different issues with regards to how tree items are drawn. The first issue is whether the boxes with the +/- signs appear to the left of (non-leaf) tree items. Two different options for the FXTreeList widget control affect this. For root-level tree items, if you pass in the TREELIST_ROOT_BOXES option you'll see these boxes; if not, you won't. For other (non-root) tree items, the TREELIST_SHOWS_BOXES option serves the same purpose. The second issue (and independent of the first) is which icon(s) are displayed when a tree item is open or closed. If you're using, for example, FXTreeList#addItemLast to append child items to a parent node, you can pass the "open" and "closed" icons as the third and fourth arguments to addItemLast: treeList.addItemLast(parentItem, "Item Text", openIcon, closedIcon) for the other methods on FXTreeList, see the API docs here: http://www.fxruby.org/doc/api So for the application you've described, it sounds like you'd want to turn off display of all of the "boxes", then use custom icons for the leaf and non-leaf items, as appropriate. > Are there any "standard" icons, or do I need to actually have my own > images, in order to add icons? You'll need to provide your own icons. Any of the icons used for tree lists in the FXRuby examples (e.g. splitter.rb) are fair game, if that helps.