Skip to content

Commit

Permalink
examples: Stop using gtk_widget_show/hide
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Clasen committed Dec 13, 2022
1 parent fba4cea commit b8962fc
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion examples/action-namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ activate (GApplication *app,
gtk_widget_set_halign (GTK_WIDGET (button), GTK_ALIGN_CENTER);
gtk_widget_set_valign (GTK_WIDGET (button), GTK_ALIGN_START);
gtk_window_set_child (GTK_WINDOW (window), button);
gtk_widget_show (win);
gtk_window_present (GTK_WINDOW (win));

g_object_unref (button_menu);
g_object_unref (doc_actions);
Expand Down
4 changes: 2 additions & 2 deletions examples/bp/bloatpad.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ new_window (GApplication *app,
G_CALLBACK (text_buffer_changed_cb), window);
text_buffer_changed_cb (gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)), window);

gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}

static void
Expand Down Expand Up @@ -465,7 +465,7 @@ edit_accels (GSimpleAction *action,

gtk_drop_down_set_selected (GTK_DROP_DOWN (combo), 0);

gtk_widget_show (dialog);
gtk_window_present (GTK_WINDOW (dialog));
}

static gboolean
Expand Down
2 changes: 1 addition & 1 deletion examples/builder.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ activate (GtkApplication *app,
button = gtk_builder_get_object (builder, "quit");
g_signal_connect_swapped (button, "clicked", G_CALLBACK (quit_cb), window);

gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
g_object_unref (builder);
}

Expand Down
2 changes: 1 addition & 1 deletion examples/drawing.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ activate (GtkApplication *app,

g_signal_connect (press, "pressed", G_CALLBACK (pressed), drawing_area);

gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}

int
Expand Down
2 changes: 1 addition & 1 deletion examples/grid-packing.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ activate (GtkApplication *app,
*/
gtk_grid_attach (GTK_GRID (grid), button, 0, 1, 2, 1);

gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));

}

Expand Down
2 changes: 1 addition & 1 deletion examples/hello/hello-world.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ activate (GtkApplication *app,

gtk_window_set_child (GTK_WINDOW (window), button);

gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}

int
Expand Down
2 changes: 1 addition & 1 deletion examples/plugman.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ new_window (GApplication *app,
}
}

gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}

static void
Expand Down
5 changes: 2 additions & 3 deletions examples/search-bar.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

static void
activate_cb (GtkApplication *app,
gpointer user_data)
gpointer user_data)
{
GtkWidget *window;
GtkWidget *search_bar;
Expand All @@ -11,12 +11,11 @@ activate_cb (GtkApplication *app,
GtkWidget *menu_button;

window = gtk_application_window_new (app);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));

search_bar = gtk_search_bar_new ();
gtk_widget_set_valign (search_bar, GTK_ALIGN_START);
gtk_window_set_child (GTK_WINDOW (window), search_bar);
gtk_widget_show (search_bar);

box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);
gtk_search_bar_set_child (GTK_SEARCH_BAR (search_bar), box);
Expand Down
2 changes: 1 addition & 1 deletion examples/sunny.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ new_window (GApplication *app,
}
}

gtk_widget_show (GTK_WIDGET (window));
gtk_window_present (GTK_WINDOW (window));
}

static void
Expand Down
2 changes: 1 addition & 1 deletion examples/window-default.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ activate (GtkApplication* app,
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
gtk_widget_show (window);
gtk_window_present (GTK_WINDOW (window));
}

int
Expand Down

0 comments on commit b8962fc

Please sign in to comment.