<ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the <linklocation="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details.</ThreadSafetyStatement>
The <seecref="T:Gtk.DrawingArea"/> widget is used for creating custom user interface elements. It's essentially a blank widget; you can draw on <paramrefname="widget"/>->window. After creating a drawing area, the application may want to connect to:
<listtype="bullet"><item><term> 1) Mouse and button press signals to respond to input from the user. (Use <seecref="M:Gtk.Widget.AddEvents"/> to enable events you wish to receive).</term></item><item><term> 2) The <paramrefname="realize"/> signal to take any necessary actions when the widget is instantiated on a particular display. (Create GDK resources in response to this signal.)</term></item><item><term> 3) The <paramrefname="configure_event"/> signal to take any necessary actions when the widget changes size.</term></item><item><term> 4) The <paramrefname="expose_event"/> signal to handle redrawing the contents of the widget.</term></item></list></para>
Expose events are normally delivered when a drawing area first comes onscreen, or when it's covered by another window and then uncovered (exposed). You can also force an expose event by adding to the "damage region" of the drawing area's window; <seecref="M:Gtk.Widget.QueueDrawArea"/> and <seecref="M:Gdk.Window.InvalidateRect"/> are equally good ways to do this. You'll then get an expose event for the invalid region. See also <seecref="M:Gdk.Pixbuf.RenderToDrawable"/> for drawing a <seecref="T:Gdk.Pixbuf"/>.