diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2009-01-18 15:50:29 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2009-01-18 15:50:29 +0000 |
commit | ade90af533edb4d24a33581233f18d965c2ed01a (patch) | |
tree | abf71fdc849a4f31c72f3529731ebf1636240cdb /demos | |
parent | c0a02a9f995890808c2b5f0f3532c862a65a34cb (diff) | |
download | gtk+-ade90af533edb4d24a33581233f18d965c2ed01a.tar.gz |
End the search if the window is closed.
* demos/gtk-demo/search_entry.c: End the search if the window
is closed.
* demos/gtk-demo/search_entry.c:
* demos/gtk-demo/entry_completion.c: Group the entry examples
under "Entry".
svn path=/trunk/; revision=22132
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/entry_completion.c | 2 | ||||
-rw-r--r-- | demos/gtk-demo/search_entry.c | 17 |
2 files changed, 16 insertions, 3 deletions
diff --git a/demos/gtk-demo/entry_completion.c b/demos/gtk-demo/entry_completion.c index fbcd856d0f..5f1e327a21 100644 --- a/demos/gtk-demo/entry_completion.c +++ b/demos/gtk-demo/entry_completion.c @@ -1,4 +1,4 @@ -/* Entry Completion +/* Entry/Entry Completion * * GtkEntryCompletion provides a mechanism for adding support for * completion in GtkEntry. diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c index 5a23a095f2..6269df2765 100644 --- a/demos/gtk-demo/search_entry.c +++ b/demos/gtk-demo/search_entry.c @@ -1,4 +1,4 @@ -/* Search Entry +/* Entry/Search Entry * * GtkEntry allows to display icons and progress information. * This demo shows how to use these features in a search entry. @@ -152,6 +152,19 @@ search_by_file (GtkWidget *item, "Search by file name\n" "Click here to change the search type"); } + +static void +search_entry_destroyed (GtkWidget *widget) +{ + if (finish_search_id != 0) + g_source_remove (finish_search_id); + + if (search_progress_id != 0) + g_source_remove (search_progress_id); + + window = NULL; +} + GtkWidget * do_search_entry (GtkWidget *do_widget) @@ -178,7 +191,7 @@ do_search_entry (GtkWidget *do_widget) g_signal_connect (window, "response", G_CALLBACK (gtk_widget_destroy), NULL); g_signal_connect (window, "destroy", - G_CALLBACK (gtk_widget_destroyed), &window); + G_CALLBACK (search_entry_destroyed), &window); vbox = gtk_vbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (window)->vbox), vbox, TRUE, TRUE, 0); |