From: <kr_...@us...> - 2003-03-14 18:38:45
|
Update of /cvsroot/htoolkit/port/src/Port In directory sc8-pr-cvs1:/tmp/cvs-serv31129/src/Port Added Files: ColorDialog.hs Log Message: Implementation for the ColorDialog --- NEW FILE: ColorDialog.hs --- {-# OPTIONS -fglasgow-exts -#include ColorDialog.h #-} ----------------------------------------------------------------------------------------- {-| Module : FileDialog Copyright : (c) Krasimir Angelov 2003 License : BSD-style Maintainer : ka2...@ya... Stability : provisional Portability : portable Standard color selection dialog. -} ----------------------------------------------------------------------------------------- module Graphics.UI.Port.ColorDialog( runColorDialog ) where import Foreign import Graphics.UI.Port.Types -- | Run a dialog to select a color. Returns 'Nothing' when cancelled. runColorDialog :: IO (Maybe Color) runColorDialog = alloca $ \cref -> do res <- osRunColorDialog cref if res then do c <- peek cref return (Just (fromCColor c)) else return Nothing foreign import ccall osRunColorDialog :: Ptr CWord -> IO Bool |