Re: Howto manage objects in DrawingArea?



On Wed, 2009-07-01 at 15:44 +0200, buergi wrote:
> Hello,
> yet another noob question:
> i need to draw objects like Bezier curves or text onto a DrawingArea.
> I derived a own class from DrawingArea and made classes for every object
> i want to draw (e.g. BezierCurve). All these objects have a draw() method.
> But to draw the object this method of course needs to have a pointer to
> the DrawingArea. Not only to get the GDK::Window to draw on but also to
> get some properties like the offset and zoom, so the object knows at
> which position it should draw.
You could simply pass arguments to the draw() that included the
offset/size. You could provide the window reference to the constructor
and only when/if it changed. Simply providing the GdkWindow and geometry
would also eliminate the circular reference issue.
Chuck
> thanks a lot in advance
> 
> buergi
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list gnome org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]