diff options
Diffstat (limited to 'examples/application10/exampleappwin.c')
-rw-r--r-- | examples/application10/exampleappwin.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/examples/application10/exampleappwin.c b/examples/application10/exampleappwin.c index d5d9be19d6..1e8eaf7327 100644 --- a/examples/application10/exampleappwin.c +++ b/examples/application10/exampleappwin.c @@ -22,9 +22,9 @@ struct _ExampleAppWindow G_DEFINE_TYPE (ExampleAppWindow, example_app_window, GTK_TYPE_APPLICATION_WINDOW) static void -search_text_changed (GtkEntry *entry) +search_text_changed (GtkEntry *entry, + ExampleAppWindow *win) { - ExampleAppWindow *win; const gchar *text; GtkWidget *tab; GtkWidget *view; @@ -36,8 +36,6 @@ search_text_changed (GtkEntry *entry) if (text[0] == '\0') return; - win = EXAMPLE_APP_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (entry))); - tab = gtk_stack_get_visible_child (GTK_STACK (win->stack)); view = gtk_bin_get_child (GTK_BIN (tab)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); @@ -153,15 +151,13 @@ update_lines (ExampleAppWindow *win) } static void -visible_child_changed (GObject *stack, - GParamSpec *pspec) +visible_child_changed (GObject *stack, + GParamSpec *pspec, + ExampleAppWindow *win) { - ExampleAppWindow *win; - if (gtk_widget_in_destruction (GTK_WIDGET (stack))) return; - win = EXAMPLE_APP_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (stack))); gtk_search_bar_set_search_mode (GTK_SEARCH_BAR (win->searchbar), FALSE); update_words (win); update_lines (win); |