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-address.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'addressbook/gui/contact-editor/e-contact-editor-address.c') diff --git a/addressbook/gui/contact-editor/e-contact-editor-address.c b/addressbook/gui/contact-editor/e-contact-editor-address.c index 1fe9337503..919fb63acb 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-address.c +++ b/addressbook/gui/contact-editor/e-contact-editor-address.c @@ -24,6 +24,7 @@ #include #include #include +#include static void e_contact_editor_address_init (EContactEditorAddress *card); static void e_contact_editor_address_class_init (EContactEditorAddressClass *klass); @@ -163,7 +164,16 @@ e_contact_editor_address_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) }; e_contact_editor_address->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_address->gui, entry_names[i]), e_contact_editor_address->editable); + GtkWidget *w = glade_xml_get_widget(e_contact_editor_address->gui, entry_names[i]); + if (GTK_IS_ENTRY (w)) { + gtk_entry_set_editable (GTK_ENTRY (w), + e_contact_editor_address->editable); + } + else if (GTK_IS_COMBO (w)) { + gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (w)->entry), + e_contact_editor_address->editable); + gtk_widget_set_sensitive (GTK_COMBO (w)->button, e_contact_editor_address->editable); + } } break; } -- cgit v1.2.3