Maintainer | diagrams-discuss@googlegroups.com |
---|---|
Safe Haskell | Safe-Infered |
Convenient interface to rendering diagrams directly on Gtk widgets using the Cairo backend.
- defaultRender :: Monoid' m => DrawingArea -> QDiagram Cairo R2 m -> IO ()
- toGtkCoords :: Monoid' m => QDiagram Cairo R2 m -> QDiagram Cairo R2 m
- renderToGtk :: (DrawableClass dc, Monoid' m) => dc -> QDiagram Cairo R2 m -> IO ()
Documentation
defaultRender :: Monoid' m => DrawingArea -> QDiagram Cairo R2 m -> IO ()Source
Render a diagram to a DrawingArea, rescaling to fit the full area.
toGtkCoords :: Monoid' m => QDiagram Cairo R2 m -> QDiagram Cairo R2 mSource
Convert a Diagram to the backend coordinates.
Provided to Query the diagram with coordinates from a mouse click event.
widget `on` buttonPressEvent $ tryEvent $ do click <- eventClick (x,y) <- eventCoordinates let result = runQuery (query $ toGtkCoords myDiagram) (P (x,y)) do_something_with result
toGtkCoords
does no rescaling of the diagram, however it is centered in
the window.
Render a diagram to a DrawableClass. No rescaling or transformations will be performed.
Typically the diagram will already have been transformed by toGtkCoords
.