From: Daniel D. C. <dhe...@gm...> - 2014-03-24 15:47:33
|
Hi gtk folks. I am writing an application using gtk3. At this point, I want to define a function that draws a picture in a canvas using cairo. What I have done so far is: * Created a new DrawingArea with "drawingAreaNew". * Created a "Render ()" value, which contains the directives to draw the picture. What I need to know is how to join these two pieces so the picture is drawn in the DrawingArea. I tried to use "renderWithDrawWindow", but it requires a DrawWindow as argument instead of a DrawingArea. However, there is no method to create a DrawWindow in gtk3. It seems this was different in the gtk package. How is this accomplished now? I have seen examples in the GitHub repo, but all the drawing seems to be associated with a "draw" event (see [1]), and I can't see how to do it outside the "draw" event. The picture I want to render will change over time, so I want to have a procedure to update it by myself. Thank you in advance for any help in this regard. Daniel Díaz. [1] - https://github.com/gtk2hs/gtk2hs/blob/master/cairo/demo/DrawingGtk3.hs |