        { `Int' } -> `()' #}
 
 {# fun Fl_readqueue as readqueue' {  } -> `Ptr ()' #}
-readqueue :: IO (Maybe (Ref Widget))
+readqueue :: IO (Maybe (Ref WidgetBase))
 readqueue = readqueue' >>= toMaybeRef
 {# fun Fl_add_timeout as addTimeout'
        { `Double', id `FunPtr CallbackPrim' } -> `()' supressWarningAboutRes #}

                   else throw e)
    Nothing -> return ()
  where
    allToplevelWindows :: [Ref Window] -> Maybe (Ref Window) -> IO [Ref Window]
    allToplevelWindows ws (Just w) = nextWindow w >>= allToplevelWindows (w:ws)
    allToplevelWindows ws Nothing = return ws

setFirstWindow wp =
    withRef wp setFirstWindow'
{# fun Fl_next_window as nextWindow' { id `Ptr ()' } -> `Ptr ()' #}
nextWindow :: Ref a -> IO (Maybe (Ref WindowBase))
nextWindow currWindow = withRef currWindow (\ptr -> nextWindow' ptr >>= toMaybeRef)

{# fun Fl_modal as modal' {  } -> `Ptr ()' #}
modal  :: IO (Maybe (Ref WidgetBase))
modal = modal' >>= toMaybeRef

{# fun Fl_grab as grab' {  } -> `Ptr ()' #}
grab  :: IO (Maybe (Ref WidgetBase))
grab = grab' >>= toMaybeRef

{# fun Fl_set_grab as setGrab'
