From: Mads <mad...@ya...> - 2005-10-23 13:38:21
|
Hi I want to develop an application which opens a GUI if there is a display available. If no display is available I want the application to gracefully switch to console mode. This leads me to the following question: How does one test if a display is available using WxHaskell? I have tried the catch (IO a -> (IOError -> IO a) -> IO a) function in the IO monad like: main =3D catch someForm ( const $ putStr "No display available\n" ) someForm =3D start $ do f <- frame [] set f [ layout :=3D widget $ label "Foo" ] but WxHaskell do not call the exception handler function. WxHaskell Just prints something like: Gtk-WARNING**: Cannot open display I would appreciate any help I can get. /Mads Lindstr=F8m |