gtk-sharp 2.12.0.0 Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. Gtk.Bin A that allows a scrollable view of its child when added to a .

To scroll correctly, a ordinarily requires explicit support from the that will be scrolled. However, a Viewport adds scrolling capabilities to an arbitrary child widget. For example, you can add a collection of widgets to a container. By simply placing the in a Viewport, you need only add the Viewport to a to visually scroll the contents of your Table.

The "model" of this widget consists of horizontal and vertical objects. These do not need to be explicitly set to use the Viewport. Packing a child widget as demonstrated in the example, below, is all that is required.

The appearance of the Viewport can be adjusted using the property.

The following example creates a in a Viewport. When placed in a small , the widgets can be scrolled.

`namespace GtkSamples { using Gtk; using System; public class ViewportApp { public static ScrolledWindow CreateViewport() { ScrolledWindow scroller = new ScrolledWindow(); Viewport viewer = new Viewport(); Table widgets = new Table(1, 2, false); widgets.Attach(new Entry("This is example Entry 1"), 0, 1, 0, 1); widgets.Attach(new Entry("This is example Entry 2"), 1, 2, 0, 1); // Place the widgets in a Viewport, and the Viewport in a ScrolledWindow viewer.Add(widgets); scroller.Add(viewer); return scroller; } public static int Main (string[] args) { Application.Init (); Window win = new Window ("Viewport Tester"); win.SetDefaultSize (180, 50); win.DeleteEvent += new DeleteEventHandler (Window_Delete); ScrolledWindow scroller = CreateViewport(); win.Add (scroller); win.ShowAll (); Application.Run (); return 0; } static void Window_Delete (object obj, DeleteEventArgs args) { Application.Quit (); args.RetVal = true; } } }`
- Constructor
  2.12.0.0
  The main way to create a Viewport.

  Horizontal and vertical objects are automatically created.

- 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.

- Constructor
  2.12.0.0
  An to model horizontal viewing.
  An to model vertical viewing.
  Creates a new Viewport with the specified horizontal and vertical Adjustments.
- Property
  2.12.0.0
  GLib.GType GType Property. a Returns the native value for .
- Property
  2.12.0.0
  GLib.Property("hadjustment")
  Gtk.Adjustment Manage the horizontal model. The current state of the horizontal model
- Method
  2.12.0.0
  GLib.DefaultSignalHandler(ConnectionMethod="OverrideScrollAdjustmentsSet", Type=typeof(Gtk.Viewport))
  System.Void `` `` a a Default handler for the event. Override this method in a subclass to provide a default handler for the event.
- Event
  2.12.0.0
  GLib.Signal("set_scroll_adjustments")
  Gtk.ScrollAdjustmentsSetHandler This event is raised when the or properties are set.
- Property
  2.12.0.0
  GLib.Property("shadow-type")
  Gtk.ShadowType Manage the shadow style surrounding the Viewport contents. The current shadow style surrounding the child widget.
- Property
  2.12.0.0
  GLib.Property("vadjustment")
  Gtk.Adjustment Manage the vertical model. The current state of the vertical model.