|Portability||non-portable (requires concurrency)|
Windows in a simple graphics library.
- data Window
- type Title = String
- data RedrawMode
- openWindowEx :: Title -> Maybe Point -> Size -> RedrawMode -> Maybe Time -> IO Window
- getWindowRect :: Window -> IO (Point, Size)
- closeWindow :: Window -> IO ()
- setGraphic :: Window -> Graphic -> IO ()
- getGraphic :: Window -> IO Graphic
- modGraphic :: Window -> (Graphic -> Graphic) -> IO ()
- directDraw :: Window -> Graphic -> IO ()
- data Event
- getWindowEvent :: Window -> IO Event
- maybeGetWindowEvent :: Window -> IO (Maybe Event)
- getWindowTick :: Window -> IO ()
- getTime :: IO Integer
How to draw in a window.
title of the window
|-> Maybe Point|
the optional initial position of a window
initial size of the window
how to display a graphic on the window
|-> Maybe Time|
the time between ticks (in milliseconds) of an optional timer associated with the window
|-> IO Window|
General window creation.
The position of the top left corner of the window on the screen, and the size of the window.
Drawing in a window
Update the drawing for a window. Note that this does not force a redraw.
Events in a window
A user interface event.
- Programmers should assume that the
Eventdatatype will be extended in the not-too-distant future and that individual events may change slightly. As a minimum, you should add a "match anything" alternative to any function which pattern matches against
- X11 systems typically have three button mice. Button 1 is used as the left button, button 3 as the right button and button 2 (the middle button) is ignored.
a properly translated character, sent after a key press.
occurs when a key was pressed or released.
occurs when a mouse button is pressed or released.
occurs when the mouse is moved inside the window.
occurs when the window is resized.
occurs when the window is closed.
Check for a pending event on the given window.
Timers that tick at regular intervals are set up by
Wait for the next tick event from the timer on the given window.