I see what's wrong.
You are passing in the TreeView gadget, where the function is expecting a Node. The TFLWidget (the thing that actually gets passed in as Parent) method InsertNode() does nothing and returns nothing, which is why it breaks.
If you change EnumFiles(BlitzMaxPath(),MyTreeView) to
EnumFiles(BlitzMaxPath(),TreeViewRoot(MyTreeView)), it works.
(should probably work on all platforms too)
Looks like FLTK GUI doesn't work in the same way that win32 GUI does.
If FLTK was more OO then this wouldn't be an issue, as the TreeView itself could have been a kind of "node"...
GTK GUI works in this way, so the code runs fine without the above modification.
HTH
You are passing in the TreeView gadget, where the function is expecting a Node. The TFLWidget (the thing that actually gets passed in as Parent) method InsertNode() does nothing and returns nothing, which is why it breaks.
If you change EnumFiles(BlitzMaxPath(),MyTreeView) to
EnumFiles(BlitzMaxPath(),TreeViewRoot(MyTreeView)), it works.
(should probably work on all platforms too)
Looks like FLTK GUI doesn't work in the same way that win32 GUI does.
If FLTK was more OO then this wouldn't be an issue, as the TreeView itself could have been a kind of "node"...
GTK GUI works in this way, so the code runs fine without the above modification.
HTH