From: Christian M. <Chr...@df...> - 2010-06-04 08:06:33
|
Axel Simon schrieb: > As follows: > > import Graphics.UI.Gtk > import Control.Monad > import Control.Concurrent [...] > ask :: IO Bool > ask = do > id <- myThreadId > putStrLn ("ask in thread "++show id) > dlg <- messageDialogNew Nothing [] MessageWarning ButtonsYesNo "yes or no" > rspns <- dialogRun dlg > widgetDestroy dlg > case rspns of > ResponseYes -> do > putStrLn "yes" > return True > _ -> do > putStrLn "no" > return False > > echo :: IO () > echo = do > b <- postGUISync ask > when b echo > > main = do > unsafeInitGUIForThreadedRTS > forkIO $ do > echo > postGUISync mainQuit > mainGUI Your code is indeed an improvement as it really works under solaris with gtk-0.9.13 and under (SuSE) linux with gtk-0.10.1. (It also does not end in "SystemziGlibziGObject_d1xz: interrupted".) >>> Besides that, yes, there was a bug in my code. I've just pushed a path >>> to fix that. If it works for you with gtk-0.11.0 then surely only, because of your patches. For the released gtk-0.11.0 version your dialog-code also blocks like my code. Are you making a new release? Or do I need to get gtk2hs from darcs? [...] >>> Why did your example lock up? I don't know exactly, to be honest. The >>> fix works although somebody should probably test your program on >>> Windows. My program will probably not run under windows since it does also does not run under solaris at least with older gtk releases. >> Under x86_solaris the example behaves worse even with gtk-0.9.13 >> by either segmentation fault or >> >> Dlg2: Cannot initialize GUI. > > I'm not sure what you are saying here. I wanted to know, if something is wrong in the way my program was written. (If so, I've got to change it.) > Does it work on Solaris with the current, patched version? I'm going to test this. Does my version work for your patched gtk under linux? (If not, it will probably not work under solaris, too. If yes, why should I change my program?) [...] Christian |