Package: gtk

Function gtk-widget-grab-focus

Lambda List

gtk-widget-grab-focus (widget)

Arguments

widget -- a gtk-widget object

Details

Causes the widget to have the keyboard focus for the gtk-window widget it is inside. The widget must be a focusable widget, such as a gtk-entry widget. Something like the gtk-frame widget will not work.

More precisely, it must have the can-focus property set. Use the gtk-widget-can-focus function to modify that property.

The widget also needs to be realized and mapped. This is indicated by the related signals. Grabbing the focus immediately after creating the widget will likely fail and cause critical warnings.
 

See also

*2021-11-30