Changeset 11229 for trunk/GUI/GraphDisplay.hs
- Timestamp:
- 07.01.2009 14:11:49 (11 months ago)
- Files:
-
- 1 modified
-
trunk/GUI/GraphDisplay.hs (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/GUI/GraphDisplay.hs
r11173 r11229 44 44 import Control.Concurrent.MVar 45 45 46 import Interfaces.DataTypes 47 46 48 initializeConverter :: IO (GInfo,HTk.HTk) 47 49 initializeConverter = do … … 54 56 graphInfo it is contained in and the conversion maps. -} 55 57 convertGraph :: ConvFunc 56 convertGraph gInfo@(GInfo { libEnvIORef = ioRefProofStatus 57 , gi_GraphInfo = actGraphInfo 58 , gi_LIB_NAME = libname 58 convertGraph gInfo@(GInfo { gi_GraphInfo = actGraphInfo 59 59 , windowCount = wc 60 60 }) title showLib = do 61 libEnv <- readIORef ioRefProofStatus 62 case Map.lookup libname libEnv of 61 ost <- readIORef $ intState gInfo 62 case i_state ost of 63 Nothing -> error "Something went wrong, no library loaded" 64 Just ist -> do 65 let libEnv = i_libEnv ist 66 libname = i_ln ist 67 case Map.lookup libname libEnv of 63 68 Just dgraph -> do 64 69 case openlock dgraph of … … 87 92 Nothing -> do 88 93 lock <- newEmptyMVar 89 writeIORef ioRefProofStatus 90 $ Map.insert libname dgraph{openlock = Just lock} libEnv 94 let nwle = Map.insert libname dgraph{openlock = Just lock} libEnv 95 nwst = ost { i_state = Just $ ist { i_libEnv = nwle}} 96 writeIORef (intState gInfo) nwst 91 97 convertGraph gInfo title showLib 92 98 Nothing -> error $ "development graph with libname " ++ show libname … … 96 102 -- return type equals the one of convertGraph 97 103 initializeGraph :: GInfo -> String -> LibFunc -> IO () 98 initializeGraph gInfo@(GInfo { gi_LIB_NAME = ln }) title showLib = do 99 let title' = (title ++ " for " ++ show ln) 100 createGraph gInfo title' (convertGraph) (showLib) 104 initializeGraph gInfo title showLib = do 105 ost <- readIORef $ intState gInfo 106 case i_state ost of 107 Nothing -> return () 108 Just ist -> do 109 let ln = i_ln ist 110 title' = (title ++ " for " ++ show ln) 111 createGraph gInfo title' (convertGraph) (showLib)