Gtk.Widget.CanDefault Property
Evaluates to true if the widget is allowed to receive the default focus.

Syntax

[GLib.Property("can-default")]
public bool CanDefault { set; get; }

Value

stem.Boolean that indicates if the widget can grab the default focus, using Widget.GrabDefault().

Remarks

When this property is set to true, the widget itself will reserve space to draw the default if possible.

If either the widget's Widget.Sensitive property or the Widget.Parent's Widget.Sensitive property evaluates to false, the Widget.CanDefault property will return false. Otherwise, the Widget.CanDefault property will return its own value.

Typically, you'd like to set the default widget using Widget.GrabDefault(), but you must set the Widget.CanDefault property to true before you call it, in order to force the focus to be grabbed into the widget.

When certain conditions are met and the user press Enter, the default widget will be focused. Conditions: the Widget.CanDefault property is set to true, the Widget.GrabDefault() has been called and the Gtk.Window containing the widget have the focus. This state is common when your window is shown for the first time, and no Widget.GrabFocus() call has been made (or when by no other means, the focus has been set to any particular widget).

Widget.GrabDefault() [FIXME] This is a seealso instead see

Widget.HasDefault [FIXME] This is a seealso instead see

Requirements

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