gtk-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. Gtk.Widget The widget is used for creating custom user interface elements.

The widget is used for creating custom user interface elements. It's essentially a blank widget; you can draw on ->window. After creating a drawing area, the application may want to connect to:

1) Mouse and button press signals to respond to input from the user. (Use to enable events you wish to receive).
2) The signal to take any necessary actions when the widget is instantiated on a particular display. (Create GDK resources in response to this signal.)
3) The signal to take any necessary actions when the widget changes size.
4) The signal to handle redrawing the contents of the widget.

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; and are equally good ways to do this. You'll then get an expose event for the invalid region. See also for drawing a .

`using System; using Gtk; using Pango; class LayoutSample : DrawingArea { Pango.Layout layout; static void Main () { Application.Init (); new LayoutSample (); Application.Run (); } LayoutSample () { Window win = new Window ("Layout sample"); win.SetDefaultSize (400, 300); win.DeleteEvent += OnWinDelete; this.Realized += OnRealized; this.ExposeEvent += OnExposed; win.Add (this); win.ShowAll (); } void OnExposed (object o, ExposeEventArgs args) { this.GdkWindow.DrawLayout (this.Style.TextGC (StateType.Normal), 100, 150, layout); } void OnRealized (object o, EventArgs args) { layout = new Pango.Layout (this.PangoContext); layout.Wrap = Pango.WrapMode.Word; layout.FontDescription = FontDescription.FromString ("Tahoma 16"); layout.SetMarkup ("Hello Pango.Layout"); } void OnWinDelete (object o, DeleteEventArgs args) { Application.Quit (); } }`
- Constructor
  2.12.0.0
  Default Constructor.
- Constructor
  2.12.0.0
  System.Obsolete
  a
  Protected Constructor.
  Chain to this constructor if you have manually registered a native value for your subclass.
- Constructor
  2.12.0.0
  Pointer to the C object.
  Internal constructor

  This is an internal constructor, and should not be used by user code.

- Property
  2.12.0.0
  GLib.GType GType Property. a Returns the native value for .
- Method
  2.12.0.0
  System.Obsolete
  System.Void `` `` a a Sets the size of the drawing area.