soegtk-0.11.0: GUI functions as used in the book "The Haskell School of Expression".Source codeContentsIndex
Graphics.SOE.Gtk
Portabilityportable (depends on GHC)
Stabilitystable
Maintainergtk2hs-devel@lists.sourceforge.net
Description

An alternative implementation of the graphics library used in The Haskell School of Expression, by Paul Hudak, <http:

It has exaclty the same interface as the original implementation Graphics.SOE. See the original for an API reference.

Synopsis
runGraphics :: IO () -> IO ()
type Title = String
type Size = (Int, Int)
data Window
openWindow :: Title -> Size -> IO Window
getWindowSize :: Window -> IO Size
clearWindow :: Window -> IO ()
drawInWindow :: Window -> Graphic -> IO ()
drawInWindowNow :: Window -> Graphic -> IO ()
setGraphic :: Window -> Graphic -> IO ()
closeWindow :: Window -> IO ()
openWindowEx :: Title -> Maybe Point -> Maybe Size -> RedrawMode -> IO Window
data RedrawMode
drawGraphic :: RedrawMode
drawBufferedGraphic :: RedrawMode
data Graphic
emptyGraphic :: Graphic
overGraphic :: Graphic -> Graphic -> Graphic
overGraphics :: [Graphic] -> Graphic
data Color
= Black
| Blue
| Green
| Cyan
| Red
| Magenta
| Yellow
| White
withColor :: Color -> Graphic -> Graphic
text :: Point -> String -> Graphic
type Point = (Int, Int)
ellipse :: Point -> Point -> Graphic
shearEllipse :: Point -> Point -> Point -> Graphic
line :: Point -> Point -> Graphic
polygon :: [Point] -> Graphic
polyline :: [Point] -> Graphic
polyBezier :: [Point] -> Graphic
type Angle = Float
arc :: Point -> Point -> Angle -> Angle -> Graphic
data Region
createRectangle :: Point -> Point -> Region
createEllipse :: Point -> Point -> Region
createPolygon :: [Point] -> Region
andRegion :: Region -> Region -> Region
orRegion :: Region -> Region -> Region
xorRegion :: Region -> Region -> Region
diffRegion :: Region -> Region -> Region
drawRegion :: Region -> Graphic
getKey :: Window -> IO Char
getLBP :: Window -> IO Point
getRBP :: Window -> IO Point
data Event
= Key {
char :: Char
isDown :: Bool
}
| Button {
pt :: Point
isLeft :: Bool
isDown :: Bool
}
| MouseMove {
pt :: Point
}
| Resize
| Closed
maybeGetWindowEvent :: Window -> IO (Maybe Event)
getWindowEvent :: Window -> IO Event
data Word32
timeGetTime :: IO Word32
word32ToInt :: Word32 -> Int
Documentation
runGraphics :: IO () -> IO ()Source
type Title = StringSource
type Size = (Int, Int)Source
data Window Source
openWindow :: Title -> Size -> IO WindowSource
getWindowSize :: Window -> IO SizeSource
clearWindow :: Window -> IO ()Source
drawInWindow :: Window -> Graphic -> IO ()Source
drawInWindowNow :: Window -> Graphic -> IO ()Source
setGraphic :: Window -> Graphic -> IO ()Source
closeWindow :: Window -> IO ()Source
openWindowEx :: Title -> Maybe Point -> Maybe Size -> RedrawMode -> IO WindowSource
data RedrawMode Source
drawGraphic :: RedrawModeSource
drawBufferedGraphic :: RedrawModeSource
data Graphic Source
emptyGraphic :: GraphicSource
overGraphic :: Graphic -> Graphic -> GraphicSource
overGraphics :: [Graphic] -> GraphicSource
data Color Source
Constructors
Black
Blue
Green
Cyan
Red
Magenta
Yellow
White
withColor :: Color -> Graphic -> GraphicSource
text :: Point -> String -> GraphicSource
type Point = (Int, Int)Source
ellipse :: Point -> Point -> GraphicSource
shearEllipse :: Point -> Point -> Point -> GraphicSource
line :: Point -> Point -> GraphicSource
polygon :: [Point] -> GraphicSource
polyline :: [Point] -> GraphicSource
polyBezier :: [Point] -> GraphicSource
type Angle = FloatSource
arc :: Point -> Point -> Angle -> Angle -> GraphicSource
data Region Source
createRectangle :: Point -> Point -> RegionSource
createEllipse :: Point -> Point -> RegionSource
createPolygon :: [Point] -> RegionSource
andRegion :: Region -> Region -> RegionSource
orRegion :: Region -> Region -> RegionSource
xorRegion :: Region -> Region -> RegionSource
diffRegion :: Region -> Region -> RegionSource
drawRegion :: Region -> GraphicSource
getKey :: Window -> IO CharSource
getLBP :: Window -> IO PointSource
getRBP :: Window -> IO PointSource
data Event Source
Constructors
Key
char :: Char
isDown :: Bool
Button
pt :: Point
isLeft :: Bool
isDown :: Bool
MouseMove
pt :: Point
Resize
Closed
maybeGetWindowEvent :: Window -> IO (Maybe Event)Source
getWindowEvent :: Window -> IO EventSource
data Word32 Source
32-bit unsigned integer type
timeGetTime :: IO Word32Source
word32ToInt :: Word32 -> IntSource
Produced by Haddock version 2.6.0