GtkWidget::grab_default

void grab_default(void);

This method sets the keyboard grab and default status on the calling widget.

The single most likely scenario where you might use this would be to set up a GtkButton so that the user could activate it by immediately pressing the return key.

In order to make this possible, you will need to set the GTK_CAN_DEFAULT widget flag on the button. See also: set_flags() .