Gtk.Widget.GetAncestor Method
Obtains the first ancestor of widget.

Syntax

public Widget GetAncestor (GLib.GType widget_type)

Parameters

widget_type
Ancestor type.

Returns

The ancesor widget, or see null if not found.

Remarks

For example sending GTK_TYPE_BOX gets the first Gtk.Box that's an ancstor of widget. No reference will be added to the retured widget; it should not be unreferenced. See note about checking for a toplevel Gtk.WIndow in the docs for Widget.Toplevel. Note that unlike Widget.IsAncestor, Widget.GetAncestor considers widget to be an ancestor of itself.

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)