I would like to display the directory structure using the Gtk # widget via F #, but itβs hard for me to figure out how to translate TreeViews into F #. Let's say I had a directory structure that looked like this:
Directory1 SubDirectory1 SubDirectory2 SubSubDirectory1 SubDirectory3 Directory2
How to show this tree structure using Gtk # widgets using F #?
EDIT:
gradbot was the answer I was hoping for with a few exceptions. If you use ListStore, you lose the ability to expand levels if you use instead:
let musicListStore = new Gtk.TreeStore([|typeof<String>; typeof<String>|])
you get a layout with extensible levels. However, this interrupts the calls to AppendValues, so you need to add some compiler hints to figure out which overloaded method to use:
musicListStore.AppendValues (iter, [|"Fannypack" ; "Nu Nu (Yeah Yeah) (double j and haze radio edit)"|])
Note that the columns are explicitly passed as an array.
Finally, you can level the levels even further using the ListIter returned by the Append Values
let iter = musicListStore.AppendValues ("Dance") let subiter = musicListStore.AppendValues (iter, [|"Fannypack" ; "Nu Nu (Yeah Yeah) (double j and haze radio edit)"|]) musicListStore.AppendValues (subiter, [|"Some Dude"; "Some Song"|]) |> ignore
source share