                                                    focus
                                                   )
 import Graphics.UI.FLTK.LowLevel.Dispatch
-import System.IO.Unsafe (unsafePerformIO)
+import qualified System.IO.Unsafe as Unsafe (unsafePerformIO)
 #c
  enum Option {
    ArrowFocus = OPTION_ARROW_FOCUS,

option o = {#call Fl_option as fl_option #} (cFromEnum o) >>= return . fromIntegral

unsafeToCallbackPrim :: GlobalCallback -> FunPtr CallbackPrim
unsafeToCallbackPrim = unsafePerformIO . toGlobalCallbackPrim

{# fun Fl_add_awake_handler_ as addAwakeHandler'
  {id `FunPtr CallbackPrim', id `(Ptr ())'} -> `Int' #}

{#enum Option {} deriving (Show) #}

ptrToGlobalEventHandler :: IORef (FunPtr GlobalEventHandlerPrim)
ptrToGlobalEventHandler = Unsafe.unsafePerformIO $ do
                            initialHandler <- toGlobalEventHandlerPrim (\_ -> return (-1))
                            newIORef initialHandler

