Say I have:
class PresentationTreeView: TreeView { … }
and am using Glade which declares a TreeView
instance. Clearly one can:
TreeView tv = cast(TreeView)builder.getObject("presentationList");
but I need tv
to be a PresentationTreeView
. If I just cast I end up with a run time error 139. So the question is what is the correct way to downcast in this situation?
gtkmm uses the get_widget_derived
approach. Is something similar not possible in D?
(Turns out I can use the same approach in D as is needed in Python if not.)