From e38cff691a83fafa33ebecb9fec28568a0a60c7f Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Mon, 17 Sep 2001 03:04:33 +0000 Subject: use enable_widget instead of gtk_widget_set_sensitive. 2001-09-16 Chris Toshok * gui/contact-editor/e-contact-editor.c (_phone_arrow_pressed): use enable_widget instead of gtk_widget_set_sensitive. (_email_arrow_pressed): same. (_address_arrow_pressed): same. (disable_widget_foreach): same. (enable_writable_fields): same. (set_editable): same. (enable_widget): new function, using both gtk_widget_set_sensitive and *_set_editable to allow the user to select text in GtkEntry's and GtkText's. * gui/contact-editor/e-contact-editor-fullname.c (e_contact_editor_fullname_set_arg): use set_editable as well as set_sensitive, to allow the user to select text in GtkEntry's. * gui/contact-editor/e-contact-editor-address.c (e_contact_editor_address_set_arg): same. svn path=/trunk/; revision=12868 --- addressbook/gui/contact-editor/e-contact-editor-fullname.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'addressbook/gui/contact-editor/e-contact-editor-fullname.c') diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index cf97854956..0af0de3236 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -24,6 +24,7 @@ #include #include #include "e-contact-editor-fullname.h" +#include static void e_contact_editor_fullname_init (EContactEditorFullname *card); static void e_contact_editor_fullname_class_init (EContactEditorFullnameClass *klass); @@ -161,9 +162,16 @@ e_contact_editor_fullname_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) }; e_contact_editor_fullname->editable = GTK_VALUE_BOOL (*arg) ? TRUE : FALSE; for (i = 0; entry_names[i] != NULL; i ++) { - gtk_widget_set_sensitive (glade_xml_get_widget(e_contact_editor_fullname->gui, - entry_names[i]), - e_contact_editor_fullname->editable); + GtkWidget *w = glade_xml_get_widget(e_contact_editor_fullname->gui, entry_names[i]); + if (GTK_IS_ENTRY (w)) { + gtk_entry_set_editable (GTK_ENTRY (w), + e_contact_editor_fullname->editable); + } + else if (GTK_IS_COMBO (w)) { + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (w)->entry), + e_contact_editor_fullname->editable); + gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_fullname->editable); + } } break; } -- cgit v1.2.3