On 10-03-14 14:13, Henk-Jan van Tuyl wrote:
> On Sun, 09 Mar 2014 20:10:28 +0100, Kristof Bastiaensen 
> <kris...@resonata.be> wrote:
>
>> I need to use a graphicpath to draw bezier curves, but wxhaskell doesn't
>> allow
>> me to create a graphicscontext from a paint event.
> :
> :
>> I am willing to help coding this functionality.
>
> It's always great if someone is willing to help improve wxHaskell, but 
> I can't say anything about this, until I have done some studying on 
> the subject.
>
I see.  I am coding this up because I really need it, but feedback
is welcome of course.  My final version is here:

https://github.com/kuribas/wxHaskell

If you like it I'll put a pull request.

I basically have this, plus helper functions (there was no wxGCDC API).
paintGc is new, and the type for paintRaw has changed:

class Paint w where
   -- | Paint double buffered to a device context. The context is always
   -- cleared before drawing. Takes the current view rectangle (adjusted
   -- for scrolling) as an argument.
   paint     :: Event w (DC () -> Rect -> IO ())
   -- | Paint directly to the on-screen device context. Takes the current
   -- view rectangle and a list of dirty rectangles as arguments.\
   paintRaw  :: Event w (PaintDC () -> Rect -> [Rect] -> IO ())
   -- | Paint double buffered to a 'GCDC' device context, for
   -- anti-aliased drawing. The context is always cleared before
   -- drawing. Takes the current view rectangle (adjusted for
   -- scrolling) as an argument.
   paintGc   :: Event w (GCDC () -> Rect -> IO ())
   -- | Emit a paint event to the specified widget.
   repaint   :: w -> IO ()

The change of type for the paintRaw event shouldn't pose compatibility
problems in most cases, otherwise it would be as simple as changing
the type from (DC ()) to (DC a).

Kristof

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
wxhaskell-devel mailing list
wxhaskell-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wxhaskell-devel

Reply via email to