Ticket #1163 (closed defect: invalid)
Return type of treeModelSortGetModel
|Reported by:||guest||Owned by:||somebody|
|Component:||general (Gtk+, Glib)||Version:||0.9.12|
Description (last modified by axel) (diff)
treeModelSortNewWithModel :: (TreeModelClass (childModel row), TypedTreeModelClass childModel) => childModel row -> IO (TypedTreeModelSort row)
Creates a new TreeModelSort?, that will be a sorted view of the given model. Methods
treeModelSortGetModel :: TreeModelSortClass self => self -> IO TreeModel
Returns the underlying model the TreeModelSort? is sorting.
I'm having problems getting the currently selected row.
showSelectedProgramme ref = do xml <- liftM stXML $ readIORef ref view <- xmlGetWidget xml MV.castToTreeView "programmeTreeView" model' <- MV.treeViewGetModel view case model' of Nothing -> return () Just model -> do rawmodel <- MV.treeModelSortGetModel model (path, col) <- MV.treeViewGetCursor view iter' <- MV.treeModelGetIter model path case iter' of Nothing -> return () Just iter -> do cIter <- MV.treeModelSortConvertIterToChildIter model iter p <- MV.treeModelGetRow rawmodel cIter displayProgrammeDetail ref p
(where ref is an IORef)
The following line is erroring p <- MV.treeModelGetRow rawmodel cIter since there doesn't seem to be a way of converting rawmodel to a typed ListStore?.