Hello, You have access to a DC when within a handler where you're supposed to draw.
For instance, for the event paint: *paint* :: Paint <Graphics-UI-WX-Events.html#t%3APaint> w => Event<Graphics-UI-WX-Events.html#t%3AEvent> w (DC <Graphics-UI-WXCore-WxcClassTypes.html#t%3ADC> () -> Rect<Graphics-UI-WXCore-WxcTypes.html#t%3ARect> -> IO<http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO> ()) The handler that you're supposed to provide is of type (DC<Graphics-UI-WXCore-WxcClassTypes.html#t%3ADC> () -> Rect <Graphics-UI-WXCore-WxcTypes.html#t%3ARect> -> IO<http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO> ()) 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: http://code.haskell.org/wxhaskell/samples/wx/Paint.hs Hope that helped. Regards, Pedro On Fri, Jan 8, 2010 at 9:45 AM, Mark Norrish <u4530...@anu.edu.au> wrote: > Hello, > 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)? > Thanks, > 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 > http://p.sf.net/sfu/verizon-dev2dev > _______________________________________________ > wxhaskell-users mailing list > wxhaskell-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/wxhaskell-users > >
------------------------------------------------------------------------------ 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 http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ wxhaskell-users mailing list wxhaskell-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wxhaskell-users