        { `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 #}

{# fun Fl_flush as flush
       {  } -> `()' supressWarningAboutRes #}
{# fun Fl_first_window as firstWindow' {  } -> `Ptr ()' #}
firstWindow :: IO (Maybe (Ref Window))
firstWindow = firstWindow' >>= toMaybeRef

{# fun Fl_set_first_window as setFirstWindow'

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