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.
Thanks. I want the ‘+’ signs. What I was getting at is that at the time the
window is displayed, the top-level nodes won’t have any children (because I’m
not inserting them into the tree until the user clicks on the node).
The default behaviour seems to be to show the ‘+’ signs when there are
children, which is fine by me. It was nice to see that when I add child
nodes after the window has been drawn, the ‘+’ signs get added automatically
… not surprising, but it would have been a pain if they weren’t.
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)
Yep. I saw that in the RDoc for the API. What I was hoping was that there
might be some way of asking FOX to use something like, say, the system’s
standard icon for a file folder … assuming such a “standard” icon exists
… rather than having to load my own image. Needing to do that isn’t really
a big issue, it just means that deploying the program requires including the
image files, rather than just giving someone the single Ruby file.
I guess I could do something sneaky like encode the icons as data and put them
after END in the Ruby code, so they can be read in at runtime. Probably
more effort than it’s worth, but I might do that, just as an experiment.
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.
Excellent! I’ll give them a go.
By the way, are there any reasonably detailed tutorials on using FOX, other
than the one that comes with the library? It’s too bad that the Ruby book
market isn’t better, because I reckon a book devoted to FX/Ruby would be
great.
Thanks for all the help.
Cheers,
Harry O.
···
On Tue, 11 Feb 2003 17:37, Lyle Johnson wrote: