I want to use Gtk# and MonoDevelop for drawing some graphic primitives (for example, line’s, rectangle’s, etc.). In the .NET Framework I used next code
Graphics graphics=pictureBox1.CreateGraphics();
graphics.DrawLine(new Pen(Color.Black), 0,0,100,100);
But how can I do it by the means of Gtk#? I found class DrawingArea, but how can I draw in that class? Could you help me please?
In the Expose handler, create a Cairo context and draw with that.
For a tutorial, see http://www.zetcode.com/tutorials/gtksharptutorial/drawing/