From: Duncan C. <dun...@us...> - 2004-07-29 00:53:51
|
Update of /cvsroot/gtk2hs/gtk2hs/gtk/general In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2969/gtk/general Modified Files: General.chs Log Message: don't use depreciated gtk main loop functions to install timout and idle handlers, use glib equivalents instead. Index: General.chs =================================================================== RCS file: /cvsroot/gtk2hs/gtk2hs/gtk/general/General.chs,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- General.chs 23 May 2004 15:58:48 -0000 1.12 +++ General.chs 29 Jul 2004 00:53:40 -0000 1.13 @@ -175,9 +175,9 @@ grabRemove :: WidgetClass w => w -> IO () grabRemove = {#call grab_remove#} . toWidget -{#pointer Function#} +{#pointer GSourceFunc as Function#} -{#pointer DestroyNotify#} +{#pointer GDestroyNotify as DestroyNotify#} #if __GLASGOW_HASKELL__>=600 @@ -216,14 +216,14 @@ timeoutAdd :: IO Bool -> Int -> IO HandlerId timeoutAdd fun msec = do (funPtr, dPtr) <- makeCallback (liftM fromBool fun) - {#call unsafe timeout_add_full#} (fromIntegral msec) funPtr nullFunPtr - nullPtr dPtr + {#call unsafe g_timeout_add_full#} (fromIntegral priorityDefault) + (fromIntegral msec) funPtr nullPtr dPtr -- | Remove a previously added timeout handler by its -- 'TimeoutId'. -- timeoutRemove :: HandlerId -> IO () -timeoutRemove = {#call unsafe timeout_remove#} +timeoutRemove id = {#call unsafe g_source_remove#} id >> return () -- | Add a callback that is called whenever the system is -- idle. @@ -236,12 +236,12 @@ idleAdd :: IO Bool -> Int -> IO HandlerId idleAdd fun pri = do (funPtr, dPtr) <- makeCallback (liftM fromBool fun) - {#call unsafe idle_add_full#} (fromIntegral pri) funPtr nullFunPtr + {#call unsafe g_idle_add_full#} (fromIntegral pri) funPtr nullPtr dPtr -- | Remove a previously added idle handler by its -- 'TimeoutId'. -- idleRemove :: HandlerId -> IO () -idleRemove = {#call unsafe idle_remove#} +idleRemove id = {#call unsafe g_source_remove#} id >> return () |