You have access to a DC when within a handler where you're supposed to draw.

For instance, for the event paint:

paint :: Paint w => Event w (DC () -> Rect -> IO ())

The handler that you're supposed to provide is of type (DC () -> Rect -> IO ()) so when that handler gets called, a DC is passed in as an argument (so you just need to define a handler function that uses it).

I suggest you see the example Paint.hs in the samples/wx folder of a source distribution:

Hope that helped.


On Fri, Jan 8, 2010 at 9:45 AM, Mark Norrish <u4530174@anu.edu.au> wrote:
I'm trying to learn how to use wxHaskell and I want to try drawing some simple objects. However, functions like circle require a (DC a) argument, and I don't know how to make a DC so I can't get anything to work. Does anyone have, say, a list of examples of how to make a (DC a)?
Mark Norrish
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
wxhaskell-users mailing list