From f2e252a2c26c589a3fdd13bf0606a25f7ae076eb Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Mon, 15 Mar 2004 01:32:20 +0000 Subject: [PATCH] Add some docs. --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ ChangeLog.pre-2-4 | 5 +++++ ChangeLog.pre-2-6 | 5 +++++ ChangeLog.pre-2-8 | 5 +++++ docs/reference/ChangeLog | 4 ++++ .../gtk/tmpl/gtkentrycompletion.sgml | 16 ++++++++++++++ gtk/gtkentrycompletion.c | 22 +++++++++++++++++++ 8 files changed, 67 insertions(+) diff --git a/ChangeLog b/ChangeLog index 053b09acb7..3955fb1aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Mon Mar 15 02:36:07 2004 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Add + some signal docs. + Sun Mar 14 15:38:39 2004 Jonathan Blandford * gtk/gtkentrycompletion.c (gtk_entry_completion_visible_func): diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 053b09acb7..3955fb1aae 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +Mon Mar 15 02:36:07 2004 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Add + some signal docs. + Sun Mar 14 15:38:39 2004 Jonathan Blandford * gtk/gtkentrycompletion.c (gtk_entry_completion_visible_func): diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 053b09acb7..3955fb1aae 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,3 +1,8 @@ +Mon Mar 15 02:36:07 2004 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Add + some signal docs. + Sun Mar 14 15:38:39 2004 Jonathan Blandford * gtk/gtkentrycompletion.c (gtk_entry_completion_visible_func): diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 053b09acb7..3955fb1aae 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,3 +1,8 @@ +Mon Mar 15 02:36:07 2004 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Add + some signal docs. + Sun Mar 14 15:38:39 2004 Jonathan Blandford * gtk/gtkentrycompletion.c (gtk_entry_completion_visible_func): diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 053b09acb7..3955fb1aae 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,3 +1,8 @@ +Mon Mar 15 02:36:07 2004 Matthias Clasen + + * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): Add + some signal docs. + Sun Mar 14 15:38:39 2004 Jonathan Blandford * gtk/gtkentrycompletion.c (gtk_entry_completion_visible_func): diff --git a/docs/reference/ChangeLog b/docs/reference/ChangeLog index b2f5c52fcb..5c2c4e8206 100644 --- a/docs/reference/ChangeLog +++ b/docs/reference/ChangeLog @@ -1,3 +1,7 @@ +Mon Mar 15 02:36:32 2004 Matthias Clasen + + * gtk/tmpl/gtkentrycompletion.sgml: Add some docs. + Tue Mar 9 09:34:10 2004 Owen Taylor * === Released 2.3.6 === diff --git a/docs/reference/gtk/tmpl/gtkentrycompletion.sgml b/docs/reference/gtk/tmpl/gtkentrycompletion.sgml index 7bb0cc98ea..48f525e951 100644 --- a/docs/reference/gtk/tmpl/gtkentrycompletion.sgml +++ b/docs/reference/gtk/tmpl/gtkentrycompletion.sgml @@ -12,6 +12,22 @@ completion functionality for GtkEntry #GtkTreeView with completion matches. +"Completion functionality" means that when the user modifies the text +in the entry, #GtkEntryCompletion checks which rows in the model match +the current content of the entry, and displays a list of matches. +By default, the matching is done by comparing the entry text +case-insensitively against the text column of the model (see +gtk_entry_completion_set_text_column()), but this can be overridden with +a custom match function (see gtk_entry_completion_set_match_func()). + + +When the user selects a completion, the content of the entry is updated. +By default, the content of the entry is replaced by the text column of the +model, but this can be overridden by connecting to the ::match-selected signal +and updating the entry in the signal handler. Note that you should return +%TRUE from the signal handler to suppress the default behaviour. + + To add completion functionality to an entry, use gtk_entry_set_completion(). diff --git a/gtk/gtkentrycompletion.c b/gtk/gtkentrycompletion.c index f30cd30459..0ca623ac2a 100644 --- a/gtk/gtkentrycompletion.c +++ b/gtk/gtkentrycompletion.c @@ -174,6 +174,19 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) object_class->get_property = gtk_entry_completion_get_property; object_class->finalize = gtk_entry_completion_finalize; + /** + * GtkEntryCompletion::match-selected: + * @widget: the object which received the signal + * @model: the #GtkTreeModel containing the matches + * @iter: a #GtkTreeIter positioned at the selected match + * + * The ::match-selected signal is emitted when a match from the list + * is selected. The default behaviour is to replace the contents of the + * entry with the contents of the text column in the row pointed to by + * @iter. + * + * Return value: %TRUE if the signal has been handled + */ entry_completion_signals[MATCH_SELECTED] = g_signal_new ("match_selected", G_TYPE_FROM_CLASS (klass), @@ -184,6 +197,15 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass) G_TYPE_BOOLEAN, 2, GTK_TYPE_TREE_MODEL, GTK_TYPE_TREE_ITER); + + /** + * GtkEntryCompletion::action-activated: + * @widget: the object which received the signal + * @index: the index of the activated action + * + * The ::action-activated signal is emitted when an action + * is activated. + */ entry_completion_signals[ACTION_ACTIVATED] = g_signal_new ("action_activated", G_TYPE_FROM_CLASS (klass),