I have a ColumnView backed by a TreeListModel with three levels, but would like to only expand the topmost level automatically. Unfortunately I can find no way to do this.
I tried calling gtk_tree_list_row_set_expanded
in the bind function call back of the first column’s SignalListItemFactory
but this caused the system to crash with SIGSEGV
. I can’t find any other point where the TreeListRow is accessible via code.
My basic Model set up is (once again, apologies for the Rust code )
let model = TreeListModel::new(plan_object, false, true, |object| {
if object.is::<SectorObject>() {
let s = object.downcast_ref::<SectorObject>().expect("Sector Object");
let so = s.clone();
Some(so.upcast::<ListModel>())
} else if object.is::<WaypointObject>() {
let wp = object.downcast_ref::<WaypointObject>().expect("Waypoint Object");
let wpo = wp.clone();
Some(wpo.upcast::<ListModel>())
} else {
None
}
});
Where both SectorObject
and WaypointObject
implement ListModel
.