See the section called Sensitivity in the chapter called GTK+ Basics. Short answer:
gtk_widget_set_sensitive(widget, FALSE);