[gtk+/gtk-3-22] searchbar: Make a code snippet compile



commit e00de3814e1427a1650494e84c24b2bcd7c6a7e1
Author: Timm Bäder <mail baedert org>
Date:   Wed Jan 3 14:37:01 2018 +0100

    searchbar: Make a code snippet compile

 gtk/gtksearchbar.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtksearchbar.c b/gtk/gtksearchbar.c
index 171ebe5..9aacc01 100644
--- a/gtk/gtksearchbar.c
+++ b/gtk/gtksearchbar.c
@@ -187,10 +187,19 @@ gtk_search_bar_handle_event_for_entry (GtkSearchBar *bar,
  *   return gtk_search_bar_handle_event (bar, event);
  * }
  *
- * g_signal_connect (window,
- *                  "key-press-event",
- *                   G_CALLBACK (on_key_press_event),
- *                   search_bar);
+ * static void
+ * create_toplevel (void)
+ * {
+ *   GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ *   GtkWindow *search_bar = gtk_search_bar_new ();
+ *
+ *  // Add more widgets to the window...
+ *
+ *   g_signal_connect (window,
+ *                    "key-press-event",
+ *                     G_CALLBACK (on_key_press_event),
+ *                     search_bar);
+ * }
  * ]|
  *
  * Returns: %GDK_EVENT_STOP if the key press event resulted


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]