diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2011-03-22 12:47:50 +0100 |
---|---|---|
committer | Carlos Garcia Campos <cgarcia@igalia.com> | 2011-03-22 12:47:50 +0100 |
commit | ddba4cc00c56e247d36776c610df87b9ca62bfaa (patch) | |
tree | 7cf11d7b3138dd05ac72bdb7ca05b6c4d87aeae6 /demos | |
parent | ec6f6c4168ecc43b76ea69b3216215689e928b4b (diff) | |
download | gtk+-ddba4cc00c56e247d36776c610df87b9ca62bfaa.tar.gz |
gtk-demo: Add placeholder text to search entry demo
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/search_entry.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/demos/gtk-demo/search_entry.c b/demos/gtk-demo/search_entry.c index 8a6d37107b..53d123418d 100644 --- a/demos/gtk-demo/search_entry.c +++ b/demos/gtk-demo/search_entry.c @@ -93,6 +93,7 @@ search_by_name (GtkWidget *item, GTK_ENTRY_ICON_PRIMARY, "Search by name\n" "Click here to change the search type"); + gtk_entry_set_placeholder_text (entry, "name"); } static void @@ -106,6 +107,7 @@ search_by_description (GtkWidget *item, GTK_ENTRY_ICON_PRIMARY, "Search by description\n" "Click here to change the search type"); + gtk_entry_set_placeholder_text (entry, "description"); } static void @@ -119,6 +121,7 @@ search_by_file (GtkWidget *item, GTK_ENTRY_ICON_PRIMARY, "Search by file name\n" "Click here to change the search type"); + gtk_entry_set_placeholder_text (entry, "file name"); } GtkWidget * @@ -246,6 +249,7 @@ do_search_entry (GtkWidget *do_widget) GtkWidget *hbox; GtkWidget *label; GtkWidget *entry; + GtkWidget *button; GtkWidget *find_button; GtkWidget *cancel_button; @@ -323,6 +327,10 @@ do_search_entry (GtkWidget *do_widget) /* add accessible alternatives for icon functionality */ g_signal_connect (entry, "populate-popup", G_CALLBACK (entry_populate_popup), NULL); + + /* Give the focus to the close button */ + button = gtk_dialog_get_widget_for_response (GTK_DIALOG (window), GTK_RESPONSE_NONE); + gtk_widget_grab_focus (button); } if (!gtk_widget_get_visible (window)) |