From: Kristof B. <kr...@re...> - 2014-03-09 19:34:09
|
Hi, I need to use a graphicpath to draw bezier curves, but wxhaskell doesn't allow me to create a graphicscontext from a paint event. The reason is the type of the function: graphicsContextCreate :: WindowDC a -> IO (GraphicsContext ()) while the paint event callback takes a DC () as argument, which is more general. It seem wxwidgets needs to know the type of the DC to create a graphicscontext. Also wxwidgets 2.8 doesn't have a function to create one from a memoryDC, but 3.0 has. One solution I came up with would be to replace DC () in the paint-event to MemoryDC (), since it's double buffered, and to PaintDC in a paint-raw event. This callback would also work with a more general function. Unfortunately it fails on Mac-OS since no memoryDc is used in the paint callback. And it still feels like a low level solution, it would be nicer to have a higher level API that can abstract away these problems. Maybe making a new paint callback that already includes the graphiccontext? Also creating a graphicspath from a haskell datatype would be nice. I am willing to help coding this functionality. Regards, Kristof Bastiaensen |