[balsa/gtk4: 89/206] Various: Replace gtk_box_pack_{start,end}()




commit c856edb4d34c904ddd2fe2bb6669349e06282bb0
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Thu Aug 27 14:46:50 2020 -0400

    Various: Replace gtk_box_pack_{start,end}()
    
    with gtk_container_add().
    
    libbalsa/address.c
    libbalsa/html.c
    libbalsa/identity.c
    libbalsa/libbalsa-gpgme-cb.c
    libbalsa/libbalsa-gpgme-widgets.c
    libbalsa/libbalsa-progress.c
    libbalsa/libbalsa.c
    libbalsa/smtp-server.c
    libbalsa/source-viewer.c
    libbalsa/x509-cert-widget.c
    libinit_balsa/assistant_page_defclient.c
    libinit_balsa/assistant_page_directory.c
    libinit_balsa/assistant_page_user.c
    src/ab-main.c
    src/ab-window.c
    src/balsa-message.c
    src/balsa-mime-widget-crypto.c
    src/balsa-mime-widget-message.c
    src/balsa-mime-widget.c
    src/filter-edit-callbacks.c
    src/filter-edit-dialog.c
    src/filter-run-dialog.c
    src/folder-conf.c
    src/main-window.c
    src/message-window.c
    src/pref-manager.c
    src/print-gtk.c
    src/sendmsg-window.c
    src/spell-check.c
    src/store-address.c
    src/toolbar-prefs.c

 libbalsa/address.c                       |  4 ++--
 libbalsa/html.c                          |  4 ++--
 libbalsa/identity.c                      | 14 ++++++------
 libbalsa/libbalsa-gpgme-cb.c             |  8 +++----
 libbalsa/libbalsa-gpgme-widgets.c        | 20 ++++++++--------
 libbalsa/libbalsa-progress.c             |  8 +++----
 libbalsa/libbalsa.c                      |  4 ++--
 libbalsa/smtp-server.c                   |  4 ++--
 libbalsa/source-viewer.c                 |  2 +-
 libbalsa/x509-cert-widget.c              |  2 +-
 libinit_balsa/assistant_page_defclient.c |  6 ++---
 libinit_balsa/assistant_page_directory.c |  2 +-
 libinit_balsa/assistant_page_user.c      |  4 ++--
 src/ab-main.c                            | 12 +++++-----
 src/ab-window.c                          | 18 +++++++--------
 src/balsa-message.c                      | 12 +++++-----
 src/balsa-mime-widget-crypto.c           | 29 ++++++++++++------------
 src/balsa-mime-widget-message.c          | 14 ++++++------
 src/balsa-mime-widget.c                  | 11 ++++-----
 src/filter-edit-callbacks.c              | 27 +++++++++++-----------
 src/filter-edit-dialog.c                 | 19 ++++++++--------
 src/filter-run-dialog.c                  | 10 ++++----
 src/folder-conf.c                        |  6 ++---
 src/main-window.c                        | 31 ++++++++++++-------------
 src/message-window.c                     |  4 ++--
 src/pref-manager.c                       | 13 ++++-------
 src/print-gtk.c                          |  4 ++--
 src/sendmsg-window.c                     | 39 ++++++++++++++++----------------
 src/spell-check.c                        | 13 ++++-------
 src/store-address.c                      |  5 ++--
 src/toolbar-prefs.c                      | 26 +++++++++------------
 31 files changed, 179 insertions(+), 196 deletions(-)
---
diff --git a/libbalsa/address.c b/libbalsa/address.c
index 495ac12e7..eb7584c76 100644
--- a/libbalsa/address.c
+++ b/libbalsa/address.c
@@ -1001,10 +1001,10 @@ libbalsa_address_get_edit_widget(LibBalsaAddress *address,
             entries[cnt] = lba_addr_list_widget(changed_cb, changed_data);
             gtk_widget_set_margin_top(label, 1);
             gtk_widget_set_margin_bottom(label, 1);
-            gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+            gtk_container_add(GTK_CONTAINER(box), label);
             gtk_widget_set_margin_top(but, 1);
             gtk_widget_set_margin_bottom(but, 1);
-            gtk_box_pack_start(GTK_BOX(box), but,   FALSE, FALSE, 0);
+            gtk_container_add(GTK_CONTAINER(box), but);
             lhs = box;
             tree_view = gtk_bin_get_child(GTK_BIN(entries[cnt]));
             g_signal_connect(but, "clicked", G_CALLBACK(add_row), tree_view);
diff --git a/libbalsa/html.c b/libbalsa/html.c
index 641326128..79773af50 100644
--- a/libbalsa/html.c
+++ b/libbalsa/html.c
@@ -769,13 +769,13 @@ libbalsa_html_new(LibBalsaMessageBody * body,
     /* Simple check for possible resource requests: */
     if (have_src_oth) {
         info->info_bar = lbh_info_bar(info);
-        gtk_box_pack_start(GTK_BOX(vbox), info->info_bar, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(vbox), info->info_bar);
         g_debug("%s shows info_bar", __func__);
     }
 
     gtk_widget_set_vexpand(GTK_WIDGET(info->web_view), TRUE);
     gtk_widget_set_valign(GTK_WIDGET(info->web_view), GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(info->web_view), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), GTK_WIDGET(info->web_view));
 
     webkit_web_view_load_html(info->web_view, text, NULL);
     g_free(text);
diff --git a/libbalsa/identity.c b/libbalsa/identity.c
index 2813aa6bf..84dfb2256 100644
--- a/libbalsa/identity.c
+++ b/libbalsa/identity.c
@@ -386,9 +386,9 @@ libbalsa_identity_select_dialog(GtkWindow * parent,
     frame = gtk_frame_new(NULL);
     gtk_widget_set_vexpand(frame, TRUE);
     gtk_widget_set_valign(frame, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX
+    gtk_container_add(GTK_CONTAINER
                        (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                       frame, FALSE, FALSE, 0);
+                       frame);
     gtk_container_add(GTK_CONTAINER(frame), tree);
     gtk_container_set_border_width(GTK_CONTAINER(frame), padding);
 
@@ -817,7 +817,7 @@ append_ident_notebook_page(GtkNotebook *notebook,
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     grid = libbalsa_create_grid();
     gtk_container_set_border_width(GTK_CONTAINER(grid), padding);
-    gtk_box_pack_start(GTK_BOX(vbox), grid, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), grid);
     gtk_notebook_append_page(notebook, vbox, gtk_label_new(tab_label));
 
     return grid;
@@ -1677,11 +1677,11 @@ libbalsa_identity_config_dialog(GtkWindow *parent, GList **identities,
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, padding);
     gtk_widget_set_vexpand(hbox, TRUE);
     gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX
+    gtk_container_add(GTK_CONTAINER
                        (gtk_dialog_get_content_area(GTK_DIALOG(dialog))),
-                       hbox, FALSE, FALSE, 0);
+                       hbox);
 
-    gtk_box_pack_start(GTK_BOX(hbox), frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), frame);
 
     smtp_server_list = g_new(GSList *, 1);
     *smtp_server_list = g_slist_copy(smtp_servers);
@@ -1694,7 +1694,7 @@ libbalsa_identity_config_dialog(GtkWindow *parent, GList **identities,
 
     gtk_widget_set_hexpand(display_frame, TRUE);
     gtk_widget_set_halign(display_frame, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox), display_frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), display_frame);
 
     select = gtk_tree_view_get_selection(tree);
     g_signal_connect(select, "changed",
diff --git a/libbalsa/libbalsa-gpgme-cb.c b/libbalsa/libbalsa-gpgme-cb.c
index 0885c04f9..d7435babb 100644
--- a/libbalsa/libbalsa-gpgme-cb.c
+++ b/libbalsa/libbalsa-gpgme-cb.c
@@ -219,11 +219,11 @@ lb_gpgme_select_key(const gchar * user_name, lb_key_sel_md_t mode, GList * keys,
        }
     label = libbalsa_create_wrap_label(prompt, FALSE);
     g_free(prompt);
-    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), label);
 
     label = gtk_label_new(_("Double-click key to show details"));
     gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), label);
 
     scrolled_window = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW
@@ -380,9 +380,7 @@ get_passphrase_real(const gchar * uid_hint, const gchar * passphrase_info,
     if (!padlock_keyhole)
        padlock_keyhole =
            gdk_pixbuf_new_from_xpm_data(padlock_keyhole_xpm);
-    gtk_box_pack_start(GTK_BOX(vbox),
-                      gtk_image_new_from_pixbuf(padlock_keyhole), FALSE,
-                      FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), gtk_image_new_from_pixbuf(padlock_keyhole));
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_container_add(GTK_CONTAINER(hbox), vbox);
     if (prev_was_bad)
diff --git a/libbalsa/libbalsa-gpgme-widgets.c b/libbalsa/libbalsa-gpgme-widgets.c
index af846c9b6..244499f30 100644
--- a/libbalsa/libbalsa-gpgme-widgets.c
+++ b/libbalsa/libbalsa-gpgme-widgets.c
@@ -134,7 +134,7 @@ libbalsa_gpgme_key(const gpgme_key_t     key,
                gtk_widget_set_margin_start(uid_box, 12);
                gtk_container_add(GTK_CONTAINER(uid_expander), uid_box);
                for (uid = key->uids->next; uid != NULL; uid = uid->next) {
-                       gtk_box_pack_end(GTK_BOX(uid_box), create_key_uid_widget(uid), FALSE, FALSE, 0U);
+                       gtk_container_add(GTK_CONTAINER(uid_box), create_key_uid_widget(uid));
                }
        }
 
@@ -222,7 +222,7 @@ libbalsa_gpgme_key(const gpgme_key_t     key,
 
                                     gtk_widget_set_margin_top(subkey_widget, 2);
                                     gtk_widget_set_margin_bottom(subkey_widget, 2);
-                                    gtk_box_pack_start(GTK_BOX(subkey_box), subkey_widget, FALSE, FALSE, 0);
+                                    gtk_container_add(GTK_CONTAINER(subkey_box), subkey_widget);
                                }
                        } else if ((((subkey_capa & GPG_SUBKEY_CAP_SIGN) != 0U) && (subkey->can_sign != 0)) ||
                                           (((subkey_capa & GPG_SUBKEY_CAP_ENCRYPT) != 0U) && 
(subkey->can_encrypt != 0)) ||
@@ -232,7 +232,7 @@ libbalsa_gpgme_key(const gpgme_key_t     key,
 
                             gtk_widget_set_margin_top(subkey_widget, 2);
                             gtk_widget_set_margin_bottom(subkey_widget, 2);
-                            gtk_box_pack_start(GTK_BOX(subkey_box), subkey_widget, FALSE, FALSE, 0);
+                            gtk_container_add(GTK_CONTAINER(subkey_box), subkey_widget);
                        } else {
                                /* do not print this subkey */
                        }
@@ -415,18 +415,18 @@ libbalsa_key_dialog(GtkWindow            *parent,
        gtk_container_set_border_width(GTK_CONTAINER(hbox), 6);
         gtk_widget_set_vexpand(hbox, TRUE);
         gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(content_area), hbox, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(content_area), hbox);
        gtk_box_set_homogeneous(GTK_BOX(hbox), FALSE);
 
        /* standard key icon; "application-certificate" would be an alternative... */
        icon = gtk_image_new_from_icon_name("dialog-password", GTK_ICON_SIZE_DIALOG);
-       gtk_box_pack_start(GTK_BOX(hbox), icon, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(hbox), icon);
        gtk_widget_set_valign(icon, GTK_ALIGN_START);
 
        vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
         gtk_widget_set_hexpand(vbox, TRUE);
         gtk_widget_set_halign(vbox, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(hbox), vbox);
        gtk_box_set_homogeneous(GTK_BOX(vbox), FALSE);
 
        if (message1 != NULL) {
@@ -436,12 +436,12 @@ libbalsa_key_dialog(GtkWindow            *parent,
                markup = g_markup_printf_escaped("<b><big>%s</big></b>", message1);
                gtk_label_set_markup(GTK_LABEL(label), markup);
                g_free(markup);
-               gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+               gtk_container_add(GTK_CONTAINER(vbox), label);
        }
 
        if (message2 != NULL) {
                label = libbalsa_create_wrap_label(message2, FALSE);
-               gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+               gtk_container_add(GTK_CONTAINER(vbox), label);
        }
 
        scrolledw = gtk_scrolled_window_new(NULL, NULL);
@@ -618,7 +618,7 @@ create_key_label_with_warn(const gchar *text,
 
                result = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
                icon = gtk_image_new_from_icon_name("dialog-warning", GTK_ICON_SIZE_MENU);
-               gtk_box_pack_start(GTK_BOX(result), icon, FALSE, FALSE, 0U);
+               gtk_container_add(GTK_CONTAINER(result), icon);
                buf = g_markup_printf_escaped("<span fgcolor=\"red\">%s</span>", text);
                label = libbalsa_create_wrap_label(buf, TRUE);
                g_free(buf);
@@ -791,7 +791,7 @@ smime_show_chain(GtkWidget *button, gpointer G_GNUC_UNUSED user_data)
         gtk_widget_set_valign(chain, GTK_ALIGN_FILL);
         gtk_widget_set_margin_top(chain, 6);
         gtk_widget_set_margin_bottom(chain, 6);
-       gtk_box_pack_start(GTK_BOX(vbox), chain, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), chain);
 
        gtk_widget_show_all(vbox);
        gtk_dialog_run(GTK_DIALOG(dialog));
diff --git a/libbalsa/libbalsa-progress.c b/libbalsa/libbalsa-progress.c
index 5ac94b0d4..3236fcc82 100644
--- a/libbalsa/libbalsa-progress.c
+++ b/libbalsa/libbalsa-progress.c
@@ -206,7 +206,7 @@ libbalsa_progress_dialog_ensure_real(ProgressDialog *progress_dialog,
 
        progress_widget = create_progress_widget(progress_id);
        gtk_revealer_set_reveal_child(GTK_REVEALER(progress_widget), TRUE);
-       gtk_box_pack_start(GTK_BOX(content_box), progress_widget, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(content_box), progress_widget);
        gtk_widget_show_all(progress_widget);
     }
 }
@@ -305,14 +305,14 @@ create_progress_widget(const gchar *progress_id)
        gtk_container_add(GTK_CONTAINER(widget_data->revealer), box);
 
        label = gtk_label_new(progress_id);
-       gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(box), label);
 
        widget_data->label = gtk_label_new(" ");
        gtk_label_set_line_wrap(GTK_LABEL(widget_data->label), TRUE);
-       gtk_box_pack_start(GTK_BOX(box), widget_data->label, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(box), widget_data->label);
 
        widget_data->progress = gtk_progress_bar_new();
-       gtk_box_pack_start(GTK_BOX(box), widget_data->progress, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(box), widget_data->progress);
 
        return widget_data->revealer;
 }
diff --git a/libbalsa/libbalsa.c b/libbalsa/libbalsa.c
index 003d6c7b9..e4c76d5e0 100644
--- a/libbalsa/libbalsa.c
+++ b/libbalsa/libbalsa.c
@@ -421,14 +421,14 @@ ask_cert_real(void *data)
     gtk_label_set_use_markup(GTK_LABEL(label), TRUE);
     gtk_widget_set_margin_top(label, 1);
     gtk_widget_set_margin_bottom(label, 1);
-    gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_area), label);
     gtk_widget_show(label);
 
     gtk_widget_set_vexpand(cert_widget, TRUE);
     gtk_widget_set_valign(cert_widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(cert_widget, 1);
     gtk_widget_set_margin_bottom(cert_widget, 1);
-    gtk_box_pack_start(GTK_BOX(content_area), cert_widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_area), cert_widget);
     gtk_widget_show_all(cert_widget);
 
     switch(gtk_dialog_run(GTK_DIALOG(dialog))) {
diff --git a/libbalsa/smtp-server.c b/libbalsa/smtp-server.c
index 4bd66d889..d1f3c1461 100644
--- a/libbalsa/smtp-server.c
+++ b/libbalsa/smtp-server.c
@@ -352,9 +352,9 @@ libbalsa_smtp_server_dialog(LibBalsaSmtpServer * smtp_server,
     sdi->big_message = gtk_spin_button_new_with_range(0.1, 100, 0.1);
     gtk_widget_set_hexpand(sdi->big_message, TRUE);
     gtk_widget_set_halign(sdi->big_message, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox), sdi->big_message, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), sdi->big_message);
     label = gtk_label_new(_("MB"));
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), label);
     if (smtp_server->big_message > 0) {
         gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(sdi->split_button), TRUE);
         /* The widget is in MB, but big_message is stored in kB. */
diff --git a/libbalsa/source-viewer.c b/libbalsa/source-viewer.c
index ee30c4c6b..8873f16f0 100644
--- a/libbalsa/source-viewer.c
+++ b/libbalsa/source-viewer.c
@@ -238,7 +238,7 @@ libbalsa_show_message_source(GtkApplication  * application,
 #else
     gtk_widget_set_margin_top(menu_bar, 1);
     gtk_widget_set_margin_bottom(menu_bar, 1);
-    gtk_box_pack_start(GTK_BOX(vbox), menu_bar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), menu_bar);
 #endif
 
     gtk_widget_set_vexpand(interior, TRUE);
diff --git a/libbalsa/x509-cert-widget.c b/libbalsa/x509-cert-widget.c
index 6e8df2299..c4653586e 100644
--- a/libbalsa/x509-cert-widget.c
+++ b/libbalsa/x509-cert-widget.c
@@ -185,7 +185,7 @@ create_chain_widget(GList *cert_list)
         gtk_widget_set_valign(stack, GTK_ALIGN_FILL);
         gtk_widget_set_margin_top(stack, 6U);
         gtk_widget_set_margin_bottom(stack, 6U);
-       gtk_box_pack_start(GTK_BOX(vbox), stack, FALSE, FALSE, 0U);
+       gtk_container_add(GTK_CONTAINER(vbox), stack);
        g_signal_connect(tree_view, "row-activated", G_CALLBACK(cert_selected_cb), stack);
 
        is_root = TRUE;
diff --git a/libinit_balsa/assistant_page_defclient.c b/libinit_balsa/assistant_page_defclient.c
index cf0cf9c88..0ee710d71 100644
--- a/libinit_balsa/assistant_page_defclient.c
+++ b/libinit_balsa/assistant_page_defclient.c
@@ -69,21 +69,21 @@ balsa_druid_page_defclient_init(BalsaDruidPageDefclient * defclient,
     gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(widget, 8);
     gtk_widget_set_margin_bottom(widget, 8);
-    gtk_box_pack_start(GTK_BOX(page), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), widget);
 
     widget = GTK_WIDGET(yes);
     gtk_widget_set_vexpand(widget, TRUE);
     gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(widget, 2);
     gtk_widget_set_margin_bottom(widget, 2);
-    gtk_box_pack_start(GTK_BOX(page), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), widget);
 
     widget = GTK_WIDGET(no);
     gtk_widget_set_vexpand(widget, TRUE);
     gtk_widget_set_valign(widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(widget, 2);
     gtk_widget_set_margin_bottom(widget, 2);
-    gtk_box_pack_start(GTK_BOX(page), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), widget);
 
     return;
 }
diff --git a/libinit_balsa/assistant_page_directory.c b/libinit_balsa/assistant_page_directory.c
index c560cb504..c7e148dda 100644
--- a/libinit_balsa/assistant_page_directory.c
+++ b/libinit_balsa/assistant_page_directory.c
@@ -306,7 +306,7 @@ balsa_druid_page_directory_init(BalsaDruidPageDirectory * dir,
     gtk_container_add(GTK_CONTAINER(page), GTK_WIDGET(grid));
     gtk_widget_show_all(GTK_WIDGET(grid));
 
-    gtk_box_pack_end(GTK_BOX(page), verify_button(dir), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), verify_button(dir));
 
     g_signal_connect(druid, "prepare",
                      G_CALLBACK(balsa_druid_page_directory_prepare),
diff --git a/libinit_balsa/assistant_page_user.c b/libinit_balsa/assistant_page_user.c
index e6aef96f4..303b4d1b8 100644
--- a/libinit_balsa/assistant_page_user.c
+++ b/libinit_balsa/assistant_page_user.c
@@ -89,7 +89,7 @@ balsa_druid_page_user_init(BalsaDruidPageUser * user,
     gtk_label_set_line_wrap(label, TRUE);
     gtk_widget_set_vexpand(GTK_WIDGET(label), TRUE);
     gtk_widget_set_valign(GTK_WIDGET(label), GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(label), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), GTK_WIDGET(label));
 
     grid = GTK_GRID(gtk_grid_new());
     gtk_grid_set_row_spacing(grid, 2);
@@ -155,7 +155,7 @@ balsa_druid_page_user_init(BalsaDruidPageUser * user,
 
     gtk_widget_set_margin_top(GTK_WIDGET(grid), 3);
     gtk_widget_set_margin_bottom(GTK_WIDGET(grid), 3);
-    gtk_box_pack_start(GTK_BOX(page), GTK_WIDGET(grid), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), GTK_WIDGET(grid));
 
     user->need_set = FALSE;
 }
diff --git a/src/ab-main.c b/src/ab-main.c
index 4731f52c0..f41ffb46b 100644
--- a/src/ab-main.c
+++ b/src/ab-main.c
@@ -879,7 +879,7 @@ bab_get_filter_box(void)
     widget = find_label;
     gtk_widget_set_margin_start(widget, 1);
     gtk_widget_set_margin_end(widget, 1);
-    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(search_hbox), widget);
 
     find_entry = gtk_entry_new();
     gtk_widget_show(find_entry);
@@ -889,7 +889,7 @@ bab_get_filter_box(void)
     gtk_widget_set_halign(widget, GTK_ALIGN_FILL);
     gtk_widget_set_margin_start(widget, 1);
     gtk_widget_set_margin_end(widget, 1);
-    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(search_hbox), widget);
 
     gtk_widget_show(search_hbox);
     gtk_label_set_mnemonic_widget(GTK_LABEL(find_label), find_entry);
@@ -902,7 +902,7 @@ bab_get_filter_box(void)
     widget = button;
     gtk_widget_set_margin_start(widget, 1);
     gtk_widget_set_margin_end(widget, 1);
-    gtk_box_pack_start(GTK_BOX(search_hbox), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(search_hbox), widget);
 
     g_signal_connect(find_entry, "activate",
                      G_CALLBACK(bab_filter_entry_activate),
@@ -969,7 +969,7 @@ bab_window_new(GtkApplication * application)
     widget = bab_get_filter_box();
     gtk_widget_set_margin_top(widget, 1);
     gtk_widget_set_margin_bottom(widget, 1);
-    gtk_box_pack_start(GTK_BOX(browse_widget), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(browse_widget), widget);
 
     scroll = gtk_scrolled_window_new(NULL, NULL);
     gtk_widget_show(scroll);
@@ -998,12 +998,12 @@ bab_window_new(GtkApplication * application)
     widget = contacts_app.edit_widget;
     gtk_widget_set_margin_top(widget, 1);
     gtk_widget_set_margin_bottom(widget, 1);
-    gtk_box_pack_start(GTK_BOX(edit_widget), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(edit_widget), widget);
 
     widget = bab_get_edit_button_box(&contacts_app);
     gtk_widget_set_margin_top(widget, 1);
     gtk_widget_set_margin_bottom(widget, 1);
-    gtk_box_pack_start(GTK_BOX(edit_widget), widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(edit_widget), widget);
 
     gtk_notebook_append_page(GTK_NOTEBOOK(contacts_app.notebook), edit_widget,
                             gtk_label_new(_("Edit")));
diff --git a/src/ab-window.c b/src/ab-window.c
index e089cb24b..c577320e2 100644
--- a/src/ab-window.c
+++ b/src/ab-window.c
@@ -279,7 +279,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
        /* More than one address book. */
        gtk_widget_show(ab->combo_box);
 
-    gtk_box_pack_start(GTK_BOX(vbox), ab->combo_box, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), ab->combo_box);
 
     /* layout grid */
     grid = gtk_grid_new();
@@ -287,7 +287,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     gtk_grid_set_column_spacing(GTK_GRID(grid), 12);
     gtk_widget_set_vexpand(grid, TRUE);
     gtk_widget_set_valign(grid, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(vbox), grid, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), grid);
     gtk_widget_show(grid);
 
     /* -- grid column 1 -- */
@@ -304,10 +304,10 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     /* Pack the find stuff into the grid */
     box2 = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 1);
     gtk_grid_attach(GTK_GRID(grid), box2, 0, 0, 1, 1);
-    gtk_box_pack_start(GTK_BOX(box2), find_label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box2), find_label);
     gtk_widget_set_vexpand(ab->filter_entry, TRUE);
     gtk_widget_set_valign(ab->filter_entry, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box2), ab->filter_entry, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box2), ab->filter_entry);
     gtk_widget_show(GTK_WIDGET(box2));
 
 
@@ -355,7 +355,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     w = gtk_button_new_from_icon_name("go-next-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_vexpand(w, TRUE);
-    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(ab->arrow_box), w);
     gtk_widget_show(w);
     g_signal_connect(w, "clicked",
                     G_CALLBACK(balsa_ab_window_move_to_recipient_list),
@@ -364,7 +364,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
     w = gtk_button_new_from_icon_name("go-previous-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_vexpand(w, TRUE);
-    gtk_box_pack_start(GTK_BOX(ab->arrow_box), w, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(ab->arrow_box), w);
     gtk_widget_show(w);
     g_signal_connect(w, "clicked",
                     G_CALLBACK(balsa_ab_window_remove_from_recipient_list),
@@ -413,11 +413,11 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     gtk_widget_set_margin_top(ab->single_address_mode_radio, 1);
     gtk_widget_set_margin_bottom(ab->single_address_mode_radio, 1);
-    gtk_box_pack_start(GTK_BOX(box2), ab->single_address_mode_radio, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box2), ab->single_address_mode_radio);
 
     gtk_widget_set_margin_top(ab->dist_address_mode_radio, 1);
     gtk_widget_set_margin_bottom(ab->dist_address_mode_radio, 1);
-    gtk_box_pack_start(GTK_BOX(box2), ab->dist_address_mode_radio, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box2), ab->dist_address_mode_radio);
 
     gtk_widget_show(box2);
 
@@ -427,7 +427,7 @@ balsa_ab_window_init(BalsaAbWindow *ab)
 
     gtk_widget_set_margin_top(frame, 1);
     gtk_widget_set_margin_bottom(frame, 1);
-    gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), frame);
 
     gtk_widget_grab_focus(ab->filter_entry);
 }
diff --git a/src/balsa-message.c b/src/balsa-message.c
index dcaf489e9..92f402d80 100644
--- a/src/balsa-message.c
+++ b/src/balsa-message.c
@@ -550,11 +550,11 @@ bm_find_bar_new(BalsaMessage * balsa_message)
     gtk_toolbar_set_style(GTK_TOOLBAR(toolbar), GTK_TOOLBAR_BOTH_HORIZ);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-    gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(_("Find:")), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), gtk_label_new(_("Find:")));
     balsa_message->find_entry = gtk_search_entry_new();
     g_signal_connect(balsa_message->find_entry, "search-changed",
                      G_CALLBACK(bm_find_entry_changed_cb), balsa_message);
-    gtk_box_pack_start(GTK_BOX(hbox), balsa_message->find_entry, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), balsa_message->find_entry);
 
     tool_item = gtk_tool_item_new();
     gtk_container_add(GTK_CONTAINER(tool_item), hbox);
@@ -883,7 +883,7 @@ balsa_message_init(BalsaMessage * balsa_message)
     GMenu *menu;
 
     balsa_message->switcher = gtk_stack_switcher_new();
-    gtk_box_pack_start(GTK_BOX(balsa_message), balsa_message->switcher, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(balsa_message), balsa_message->switcher);
 
     balsa_message->stack = gtk_stack_new();
     stack = GTK_STACK(balsa_message->stack);
@@ -1005,7 +1005,7 @@ balsa_message_init(BalsaMessage * balsa_message)
 
     /* Find-in-message search bar, initially hidden. */
     balsa_message->find_bar = bm_find_bar_new(balsa_message);
-    gtk_box_pack_start(GTK_BOX(vbox), balsa_message->find_bar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), balsa_message->find_bar);
 
     /* The context menu that is popped up when more than one part is selected */
     balsa_message_add_actions(balsa_message, "message-menu");
@@ -1716,7 +1716,7 @@ display_face(BalsaMessage * balsa_message)
         }
 
         if (image != NULL) {
-            gtk_box_pack_start(GTK_BOX(face_box), image, FALSE, FALSE, 0);
+            gtk_container_add(GTK_CONTAINER(face_box), image);
             gtk_widget_show_all(face_box);
         }
     }
@@ -2300,7 +2300,7 @@ add_part(BalsaMessage * balsa_message, BalsaPartInfo * info, GtkWidget * contain
     if (info->mime_widget == NULL)
        part_info_init(balsa_message, info);
 
-    gtk_box_pack_start(GTK_BOX(container), GTK_WIDGET(info->mime_widget), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(container), GTK_WIDGET(info->mime_widget));
 
     info_container = balsa_mime_widget_get_container(info->mime_widget);
     body = add_multipart(balsa_message, info->body,
diff --git a/src/balsa-mime-widget-crypto.c b/src/balsa-mime-widget-crypto.c
index e5ef4a41d..a5d3f17ed 100644
--- a/src/balsa-mime-widget-crypto.c
+++ b/src/balsa-mime-widget-crypto.c
@@ -34,7 +34,8 @@
 
 static void on_gpg_key_button(GtkWidget *button, const gchar *fingerprint);
 static void on_key_import_button(GtkButton *button, gpointer user_data);
-static gboolean create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error);
+static gboolean create_import_keys_widget(BalsaMimeWidget *mw, const gchar *key_buf, GError **error);
+
 
 
 BalsaMimeWidget *
@@ -78,7 +79,7 @@ balsa_mime_widget_new_pgpkey(BalsaMessage        *bm,
         g_clear_error(&err);
     } else {
         mw = g_object_new(BALSA_TYPE_MIME_WIDGET, NULL);
-        if (!create_import_keys_widget(GTK_BOX(mw), body_buf, &err)) {
+        if (!create_import_keys_widget(mw, body_buf, &err)) {
             balsa_information(LIBBALSA_INFORMATION_ERROR, _("Could not process GnuPG keys: %s"),
                               err ? err->message : "Unknown error");
             g_clear_error(&err);
@@ -117,13 +118,13 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
     label = gtk_label_new((lines[1] != NULL) ? lines[1] : lines[0]);
     gtk_label_set_selectable(GTK_LABEL(label), TRUE);
     gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), label);
     key = g_mime_gpgme_sigstat_key(mime_body->sig_info);
     if (key != NULL) {
                GtkWidget *key_widget;
 
                key_widget = libbalsa_gpgme_key(key, g_mime_gpgme_sigstat_fingerprint(mime_body->sig_info), 
0U, FALSE);
-               gtk_box_pack_start(GTK_BOX(vbox), key_widget, FALSE, FALSE, 0);
+               gtk_container_add(GTK_CONTAINER(vbox), key_widget);
     }
     if (g_mime_gpgme_sigstat_protocol(mime_body->sig_info) == GPGME_PROTOCOL_OpenPGP) {
        GtkWidget *hbox;
@@ -135,7 +136,7 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
 
         gtk_widget_set_vexpand(hbox, TRUE);
         gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-        gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(vbox), hbox);
         if (g_mime_gpgme_sigstat_status(mime_body->sig_info) == GPG_ERR_NO_PUBKEY) {
 #ifdef ENABLE_AUTOCRYPT
                GBytes *autocrypt_key;
@@ -147,7 +148,7 @@ balsa_mime_widget_signature_widget(LibBalsaMessageBody * mime_body,
                        g_signal_connect(button, "clicked", G_CALLBACK(on_key_import_button), NULL);
                         gtk_widget_set_hexpand(button, TRUE);
                         gtk_widget_set_halign(button, GTK_ALIGN_FILL);
-                       gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+                       gtk_container_add(GTK_CONTAINER(hbox), button);
                }
 #endif
             button = gtk_button_new_with_mnemonic(_("_Search key server for this key"));
@@ -200,7 +201,7 @@ balsa_mime_widget_crypto_frame(LibBalsaMessageBody * mime_body, GtkWidget * chil
     if (was_encrypted) {
        icon = gtk_image_new_from_icon_name(balsa_icon_id(BALSA_PIXMAP_ENCR), GTK_ICON_SIZE_MENU);
        gtk_widget_set_tooltip_text(icon, _("decrypted"));
-        gtk_box_pack_start(GTK_BOX(icon_box), icon, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(icon_box), icon);
     }
     if (!no_signature) {
        LibBalsaMsgProtectState sig_state = libbalsa_message_body_protect_state(mime_body);
@@ -223,15 +224,15 @@ balsa_mime_widget_crypto_frame(LibBalsaMessageBody * mime_body, GtkWidget * chil
        default:
                gtk_widget_set_tooltip_text(icon, _("unknown signature status"));
        }
-        gtk_box_pack_start(GTK_BOX(icon_box), icon, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(icon_box), icon);
     }
     gtk_frame_set_label_widget(GTK_FRAME(frame), icon_box);
     gtk_container_set_border_width(GTK_CONTAINER(vbox), BMW_MESSAGE_PADDING);
 
-    gtk_box_pack_start(GTK_BOX(vbox), child, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), child);
 
     if (signature) {
-       gtk_box_pack_end(GTK_BOX(vbox), signature, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), signature);
     }
 
     return frame;
@@ -324,7 +325,7 @@ on_key_import_button(GtkButton *button,
 
 
 static gboolean
-create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error)
+create_import_keys_widget(BalsaMimeWidget *mw, const gchar *key_buf, GError **error)
 {
        gboolean success = FALSE;
        gpgme_ctx_t ctx;
@@ -357,12 +358,12 @@ create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error)
                                                success = FALSE;
                                        } else {
                                                key_widget = libbalsa_gpgme_key(this_key, NULL, 
GPG_SUBKEY_CAP_ALL, FALSE);
-                                               gtk_box_pack_start(box, key_widget, FALSE, FALSE, 0);
+                                               gtk_container_add(GTK_CONTAINER(mw), key_widget);
 
                                                import_btn = gtk_button_new_with_label(_("Import key into the 
local key ring"));
                                                g_object_set_data_full(G_OBJECT(import_btn), "keydata", 
key_ascii, (GDestroyNotify) g_free);
                                                g_signal_connect(import_btn, "clicked", (GCallback) 
on_key_import_button, NULL);
-                                               gtk_box_pack_start(box, import_btn, FALSE, FALSE, 0);
+                                               gtk_container_add(GTK_CONTAINER(mw), import_btn);
 
                                                if (item->next != NULL) {
                                                     GtkWidget *separator =
@@ -371,7 +372,7 @@ create_import_keys_widget(GtkBox *box, const gchar *key_buf, GError **error)
                                                                               BMW_VBOX_SPACE);
                                                     gtk_widget_set_margin_bottom(separator,
                                                                                  BMW_VBOX_SPACE);
-                                                    gtk_box_pack_start(box, separator, FALSE, FALSE, 0);
+                                                    gtk_container_add(GTK_CONTAINER(mw), separator);
                                                }
                                        }
                                }
diff --git a/src/balsa-mime-widget-message.c b/src/balsa-mime-widget-message.c
index 56825514f..88487209e 100644
--- a/src/balsa-mime-widget-message.c
+++ b/src/balsa-mime-widget-message.c
@@ -141,7 +141,7 @@ balsa_mime_widget_new_message(BalsaMessage * bm,
         emb_hdrs = bm_header_widget_new(bm, NULL);
         balsa_mime_widget_set_header_widget(mw, emb_hdrs);
 
-       gtk_box_pack_start(GTK_BOX(container), emb_hdrs, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(container), emb_hdrs);
 
         bmw_message_set_headers(bm, mw, mime_body,
                                 balsa_message_get_shown_headers(bm) == HEADERS_ALL);
@@ -245,13 +245,13 @@ bmw_message_extbody_url(LibBalsaMessageBody * mime_body,
     gtk_container_set_border_width(GTK_CONTAINER(mw),
                                   BMW_CONTAINER_BORDER);
 
-    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), gtk_label_new(msg->str));
     g_string_free(msg, TRUE);
 
     button = gtk_button_new_with_label(url);
     gtk_widget_set_margin_top(button, BMW_BUTTON_PACK_SPACE);
     gtk_widget_set_margin_bottom(button, BMW_BUTTON_PACK_SPACE);
-    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), button);
 
     g_object_set_data_full(G_OBJECT(button), "call_url", url,
                           (GDestroyNotify) g_free);
@@ -292,7 +292,7 @@ bmw_message_extbody_mail(LibBalsaMessageBody * mime_body)
     gtk_container_set_border_width(GTK_CONTAINER(mw),
                                   BMW_CONTAINER_BORDER);
 
-    gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg->str), FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), gtk_label_new(msg->str));
     g_string_free(msg, TRUE);
 
     button =
@@ -300,7 +300,7 @@ bmw_message_extbody_mail(LibBalsaMessageBody * mime_body)
                                     ("Se_nd message to obtain this part"));
     gtk_widget_set_margin_top(button, BMW_BUTTON_PACK_SPACE);
     gtk_widget_set_margin_bottom(button, BMW_BUTTON_PACK_SPACE);
-    gtk_box_pack_start(GTK_BOX(mw), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), button);
     g_signal_connect(button, "clicked",
                     G_CALLBACK(extbody_send_mail), (gpointer) mime_body);
 
@@ -415,7 +415,7 @@ balsa_mime_widget_new_message_tl(BalsaMessage * bm,
     headers = bm_header_widget_new(bm, tl_buttons);
     balsa_mime_widget_set_header_widget(mw, headers);
 
-    gtk_box_pack_start(GTK_BOX(mw), headers, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), headers);
 
     container = gtk_box_new(GTK_ORIENTATION_VERTICAL, BMW_MESSAGE_PADDING);
     balsa_mime_widget_set_container(mw, container);
@@ -424,7 +424,7 @@ balsa_mime_widget_new_message_tl(BalsaMessage * bm,
     gtk_widget_set_valign(container, GTK_ALIGN_FILL);
     gtk_widget_set_margin_top(container, BMW_CONTAINER_BORDER - BMW_MESSAGE_PADDING);
     gtk_widget_set_margin_bottom(container, BMW_CONTAINER_BORDER - BMW_MESSAGE_PADDING);
-    gtk_box_pack_start(GTK_BOX(mw), container, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), container);
 
     return mw;
 }
diff --git a/src/balsa-mime-widget.c b/src/balsa-mime-widget.c
index 27022b88b..e8682a261 100644
--- a/src/balsa-mime-widget.c
+++ b/src/balsa-mime-widget.c
@@ -204,7 +204,7 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
 
     if (mime_body->filename) {
        msg = g_strdup_printf(_("File name: %s"), mime_body->filename);
-       gtk_box_pack_start(GTK_BOX(mw), gtk_label_new(msg), FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(mw), gtk_label_new(msg));
        g_free(msg);
     }
 
@@ -258,7 +258,7 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
     msg_label = gtk_label_new(msg);
     g_free(msg);
     gtk_label_set_ellipsize(GTK_LABEL(msg_label), PANGO_ELLIPSIZE_END);
-    gtk_box_pack_start(GTK_BOX(mw), msg_label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), msg_label);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, BMW_HBOX_SPACE);
     gtk_box_set_homogeneous(GTK_BOX(hbox), TRUE);
@@ -269,10 +269,9 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
         gtk_widget_set_halign(button, GTK_ALIGN_FILL);
         gtk_container_add(GTK_CONTAINER(hbox), button);
     } else {
-       gtk_box_pack_start(GTK_BOX(mw),
+       gtk_container_add(GTK_CONTAINER(mw),
                           gtk_label_new(_("No open or view action "
-                                          "defined for this content type")),
-                          FALSE, FALSE, 0);
+                                          "defined for this content type")));
     }
     g_free(use_content_type);
 
@@ -284,7 +283,7 @@ balsa_mime_widget_new_unknown(BalsaMessage * bm,
                     G_CALLBACK(balsa_mime_widget_ctx_menu_save),
                     (gpointer) mime_body);
 
-    gtk_box_pack_start(GTK_BOX(mw), hbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(mw), hbox);
 
     return mw;
 }
diff --git a/src/filter-edit-callbacks.c b/src/filter-edit-callbacks.c
index 481199cd5..a54888770 100644
--- a/src/filter-edit-callbacks.c
+++ b/src/filter-edit-callbacks.c
@@ -1006,7 +1006,7 @@ build_type_notebook()
     g_object_set(box, "margin", 5, NULL);
     gtk_widget_set_vexpand(grid, TRUE);
     gtk_widget_set_valign(grid, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), grid, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), grid);
 
     fe_type_simple_label = 
        gtk_label_new_with_mnemonic(_("One of the specified f_ields contains"));
@@ -1038,7 +1038,7 @@ build_type_notebook()
     page = gtk_table_new(5, 6, FALSE);
     gtk_widget_set_vexpand(page, TRUE);
     gtk_widget_set_valign(page, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), page, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), page);
 
     fe_type_regex_label = 
         gtk_label_new_with_mnemonic(_("_One of the regular expressions matches"));
@@ -1073,21 +1073,21 @@ build_type_notebook()
     button = gtk_button_new_with_mnemonic(_("A_dd"));
     gtk_widget_set_hexpand(button, TRUE);
     gtk_widget_set_halign(button, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), button);
     g_signal_connect(button, "clicked",
                      G_CALLBACK(fe_add_pressed), NULL);
 
     fe_regex_remove_button = gtk_button_new_with_mnemonic(_("_Remove"));
     gtk_widget_set_hexpand(fe_regex_remove_button, TRUE);
     gtk_widget_set_halign(fe_regex_remove_button, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), fe_regex_remove_button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), fe_regex_remove_button);
     g_signal_connect(fe_regex_remove_button, "clicked",
                      G_CALLBACK(fe_remove_pressed), NULL);
 
     button = gtk_button_new_with_mnemonic(_("One _Matches/None Matches"));
     gtk_widget_set_hexpand(button, TRUE);
     gtk_widget_set_halign(button, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), button);
     g_signal_connect(button, "clicked",
                      G_CALLBACK(fe_negate_condition), NULL);
 
@@ -1101,7 +1101,7 @@ build_type_notebook()
     label = gtk_label_new(msg);
     gtk_widget_set_hexpand(label, TRUE);
     gtk_widget_set_halign(label, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), label);
 #endif                  /* REGULAR_EXPRESSION_FILTERING_IS_IMPLEMENTED */
 
     /* The date page of the notebook */
@@ -1182,7 +1182,7 @@ void build_condition_dialog(GtkWidget * condition_dialog)
 {
     GtkWidget *label,* box;
     GtkWidget *field_frame = get_field_frame();
-    GtkBox *content_box;
+    GtkWidget *content_box;
 
     /* builds the toggle buttons to specify fields concerned by the
      * conditions of the filter */
@@ -1191,31 +1191,30 @@ void build_condition_dialog(GtkWidget * condition_dialog)
     label = gtk_label_new_with_mnemonic(_("Search T_ype:"));
     gtk_widget_set_margin_start(label, 5);
     gtk_widget_set_margin_end(label, 5);
-    gtk_box_pack_start(GTK_BOX(box), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), label);
 
     fe_search_option_menu =
         fe_build_option_menu(fe_search_type, G_N_ELEMENTS(fe_search_type),
                              G_CALLBACK(fe_typesmenu_cb), field_frame);
     gtk_widget_set_margin_start(fe_search_option_menu, 5);
     gtk_widget_set_margin_end(fe_search_option_menu, 5);
-    gtk_box_pack_start(GTK_BOX(box), fe_search_option_menu, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), fe_search_option_menu);
     gtk_label_set_mnemonic_widget(GTK_LABEL(label), fe_search_option_menu);
 
-    content_box =
-        GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(condition_dialog)));
+    content_box = gtk_dialog_get_content_area(GTK_DIALOG(condition_dialog));
 
     gtk_widget_set_margin_top(box, 2);
     gtk_widget_set_margin_bottom(box, 2);
-    gtk_box_pack_start(content_box, box, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_box), box);
 
     gtk_widget_set_margin_top(field_frame, 2);
     gtk_widget_set_margin_bottom(field_frame, 2);
-    gtk_box_pack_start(content_box, field_frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_box), field_frame);
 
     build_type_notebook();
     gtk_widget_set_margin_top(fe_type_notebook, 2);
     gtk_widget_set_margin_bottom(fe_type_notebook, 2);
-    gtk_box_pack_start(content_box, fe_type_notebook, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_box), fe_type_notebook);
 }
 
 /*
diff --git a/src/filter-edit-dialog.c b/src/filter-edit-dialog.c
index e2c3dcdb8..4b0cb7092 100644
--- a/src/filter-edit-dialog.c
+++ b/src/filter-edit-dialog.c
@@ -222,7 +222,7 @@ build_left_side(void)
     gtk_box_set_spacing(GTK_BOX(bbox), 2);
     gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
 
-    gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* new button */
     /* Translators: button "New" filter */
@@ -289,7 +289,7 @@ build_match_page()
                      G_CALLBACK(fe_action_changed), NULL);
     gtk_widget_set_margin_top(fe_op_codes_option_menu, 2);
     gtk_widget_set_margin_bottom(fe_op_codes_option_menu, 2);
-    gtk_box_pack_start(GTK_BOX(box), fe_op_codes_option_menu, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), fe_op_codes_option_menu);
 
     /* list of conditions defining how this filter matches */
 
@@ -390,7 +390,7 @@ build_action_page(GtkWindow * window)
     frame = gtk_frame_new(_("Notification:"));
     gtk_frame_set_label_align(GTK_FRAME(frame), GTK_POS_LEFT, GTK_POS_TOP);
     gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
-    gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), frame);
     gtk_container_set_border_width(GTK_CONTAINER(frame), 3);
 
     grid = gtk_grid_new();
@@ -442,7 +442,7 @@ build_action_page(GtkWindow * window)
     frame = gtk_frame_new(_("Action to perform:"));
     gtk_frame_set_label_align(GTK_FRAME(frame), GTK_POS_LEFT, GTK_POS_TOP);
     gtk_frame_set_shadow_type(GTK_FRAME(frame), GTK_SHADOW_ETCHED_IN);
-    gtk_box_pack_start(GTK_BOX(page), frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(page), frame);
 
     box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
     gtk_box_set_homogeneous(GTK_BOX(box), TRUE);
@@ -511,7 +511,7 @@ build_right_side(GtkWindow * window)
 
     /* button box */
     bbox = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
-    gtk_box_pack_start(GTK_BOX(rightside), bbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(rightside), bbox);
 
     fe_apply_button = gtk_button_new_with_mnemonic(_("_Apply"));
     g_signal_connect(fe_apply_button, "clicked",
@@ -612,11 +612,10 @@ filters_edit_dialog(GtkWindow * parent)
 
     gtk_widget_set_margin_start(piece, FILTER_EDIT_PADDING);
     gtk_widget_set_margin_end(piece, FILTER_EDIT_PADDING);
-    gtk_box_pack_start(GTK_BOX(hbox), piece, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), piece);
 
-    gtk_box_pack_start(GTK_BOX(hbox),
-                       gtk_separator_new(GTK_ORIENTATION_VERTICAL),
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox),
+                      gtk_separator_new(GTK_ORIENTATION_VERTICAL));
 
     fe_right_page = build_right_side(GTK_WINDOW(fe_window));
     gtk_widget_set_sensitive(fe_right_page, FALSE);
@@ -625,7 +624,7 @@ filters_edit_dialog(GtkWindow * parent)
     gtk_widget_set_halign(fe_right_page, GTK_ALIGN_FILL);
     gtk_widget_set_margin_start(fe_right_page, FILTER_EDIT_PADDING);
     gtk_widget_set_margin_end(fe_right_page, FILTER_EDIT_PADDING);
-    gtk_box_pack_start(GTK_BOX(hbox), fe_right_page, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), fe_right_page);
 
     fe_user_headers_list = NULL;
 
diff --git a/src/filter-run-dialog.c b/src/filter-run-dialog.c
index cf66bbddc..1ad14b7eb 100644
--- a/src/filter-run-dialog.c
+++ b/src/filter-run-dialog.c
@@ -316,7 +316,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
     gtk_widget_set_hexpand(vbox, TRUE);
     gtk_widget_set_halign(vbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), vbox);
 
     p->available_filters =
         libbalsa_filter_list_new(TRUE, _("Name"), GTK_SELECTION_MULTIPLE,
@@ -344,7 +344,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
     gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
     gtk_widget_set_margin_top(bbox, 2);
     gtk_widget_set_margin_bottom(bbox, 2);
-    gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* "Apply selected" button */
     p->apply_selected_button = button =
@@ -382,13 +382,13 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
 
     gtk_widget_set_margin_start(bbox, 6);
     gtk_widget_set_margin_end(bbox, 6);
-    gtk_box_pack_start(GTK_BOX(hbox), bbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), bbox);
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 2);
 
     gtk_widget_set_hexpand(vbox, TRUE);
     gtk_widget_set_halign(vbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox),vbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox),vbox);
 
     sw = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
@@ -416,7 +416,7 @@ balsa_filter_run_dialog_init(BalsaFilterRunDialog *p)
 
     gtk_widget_set_margin_top(bbox, 2);
     gtk_widget_set_margin_bottom(bbox, 2);
-    gtk_box_pack_start(GTK_BOX(vbox), bbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), bbox);
 
     /* up button */
     p->move_up_button = button =
diff --git a/src/folder-conf.c b/src/folder-conf.c
index 95d3cbf94..285d05386 100644
--- a/src/folder-conf.c
+++ b/src/folder-conf.c
@@ -355,7 +355,7 @@ create_imap_folder_dialog(LibBalsaServer  *server,
        gtk_widget_set_vexpand(vbox, TRUE);
 
        label = libbalsa_create_wrap_label(message, FALSE);
-       gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), label);
 
        scrolled_wind = gtk_scrolled_window_new(NULL,NULL);
        gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(scrolled_wind),
@@ -514,7 +514,7 @@ folder_conf_imap_node(BalsaMailboxNode *mn)
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(folder_data->subscribed), FALSE);
        gtk_widget_set_sensitive(button, FALSE);
     }
-    gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), button);
     g_signal_connect(folder_data->subscribed, "toggled", G_CALLBACK(folder_data_subscribed_toggled), button);
     libbalsa_server_cfg_add_row(folder_data->server_cfg, TRUE, box, NULL);
 
@@ -915,7 +915,7 @@ folder_conf_imap_sub_node(BalsaMailboxNode * mn)
     gtk_widget_set_hexpand(sub_folder_data->parent_folder, TRUE);
     gtk_widget_set_halign(sub_folder_data->parent_folder, GTK_ALIGN_FILL);
     gtk_container_add(GTK_CONTAINER(hbox), sub_folder_data->parent_folder);
-    gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), button);
 
     gtk_widget_set_hexpand(hbox, TRUE);
     gtk_grid_attach(GTK_GRID(grid), hbox, 1, row, 1, 1);
diff --git a/src/main-window.c b/src/main-window.c
index d759b263e..3a9156b34 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -527,8 +527,7 @@ bw_create_index_widget(BalsaWindow *bw)
     priv->sos_bar = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5);
 
     priv->filter_choice = gtk_combo_box_text_new();
-    gtk_box_pack_start(GTK_BOX(priv->sos_bar), priv->filter_choice,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(priv->sos_bar), priv->filter_choice);
     for(i=0; i<G_N_ELEMENTS(view_filters); i++)
         gtk_combo_box_text_insert_text(GTK_COMBO_BOX_TEXT(priv->filter_choice),
                                        i, view_filters[i].str);
@@ -554,7 +553,7 @@ bw_create_index_widget(BalsaWindow *bw)
     gtk_container_add(GTK_CONTAINER(priv->sos_bar), priv->sos_entry);
     gtk_widget_show(priv->sos_entry);
 
-    gtk_box_pack_start(GTK_BOX(priv->sos_bar), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(priv->sos_bar), button);
     g_signal_connect(priv->sos_entry, "activate",
                      G_CALLBACK(bw_filter_entry_activate),
                      button);
@@ -570,7 +569,7 @@ bw_create_index_widget(BalsaWindow *bw)
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     gtk_widget_show(priv->sos_bar);
-    gtk_box_pack_start(GTK_BOX(vbox), priv->sos_bar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), priv->sos_bar);
 
     gtk_widget_set_vexpand(priv->notebook, TRUE);
     gtk_widget_set_valign(priv->notebook, GTK_ALIGN_FILL);
@@ -2102,7 +2101,7 @@ bw_set_menus(BalsaWindow * window)
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu(window, GTK_MENU_SHELL(menubar));
 #else
-    gtk_box_pack_start(GTK_BOX(priv->vbox), menubar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(priv->vbox), menubar);
 #endif
 }
 
@@ -2251,7 +2250,7 @@ balsa_window_new(GtkApplication *application)
     model = balsa_window_get_toolbar_model();
 
     priv->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
-    gtk_box_pack_start(GTK_BOX(priv->vbox), priv->toolbar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(priv->vbox), priv->toolbar);
 
     priv->content_area = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
     gtk_widget_show(priv->content_area);
@@ -2260,7 +2259,7 @@ balsa_window_new(GtkApplication *application)
     gtk_container_add(GTK_CONTAINER(priv->vbox), priv->content_area);
 
     priv->bottom_bar = hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-    gtk_box_pack_start(GTK_BOX(priv->vbox), hbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(priv->vbox), hbox);
 
     priv->progress_bar = gtk_progress_bar_new();
     g_object_add_weak_pointer(G_OBJECT(priv->progress_bar),
@@ -2268,7 +2267,7 @@ balsa_window_new(GtkApplication *application)
     gtk_widget_set_valign(priv->progress_bar, GTK_ALIGN_CENTER);
     gtk_progress_bar_set_pulse_step(GTK_PROGRESS_BAR(priv->progress_bar),
                                     0.01);
-    gtk_box_pack_start(GTK_BOX(hbox), priv->progress_bar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), priv->progress_bar);
 
     priv->statusbar = gtk_statusbar_new();
     gtk_widget_set_hexpand(priv->statusbar, TRUE);
@@ -2842,7 +2841,7 @@ bw_notebook_label_new(BalsaMailboxNode * mbnode)
     close_pix = gtk_image_new_from_icon_name("window-close-symbolic",
                                              GTK_ICON_SIZE_MENU);
     gtk_container_add(GTK_CONTAINER(but), close_pix);
-    gtk_box_pack_start(GTK_BOX(box), but, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), but);
 
     gtk_widget_show_all(box);
 
@@ -3840,7 +3839,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(page, 2);
         gtk_widget_set_margin_bottom(page, 2);
-       gtk_box_pack_start(GTK_BOX(vbox), page, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), page);
 
        /* builds the toggle buttons to specify fields concerned by
          * the search. */
@@ -3853,7 +3852,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), frame);
 
        grid = gtk_grid_new();
         gtk_grid_set_column_homogeneous(GTK_GRID(grid), TRUE);
@@ -3871,7 +3870,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), frame);
 
        /* Button box */
        box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
@@ -3895,7 +3894,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_margin_top(frame, 2);
         gtk_widget_set_margin_bottom(frame, 2);
-       gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(vbox), frame);
 
        /* Reverse and Wrap checkboxes */
        box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
@@ -3913,7 +3912,7 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_vexpand(reverse_button, TRUE);
         gtk_widget_set_valign(reverse_button, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(w), reverse_button, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(w), reverse_button);
 
        wrap_button =
             gtk_check_button_new_with_mnemonic(_("_Wrap around"));
@@ -3922,11 +3921,11 @@ bw_find_real(BalsaWindow * window, BalsaIndex * bindex, gboolean again)
 
         gtk_widget_set_vexpand(wrap_button, TRUE);
         gtk_widget_set_valign(wrap_button, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(w), wrap_button, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(w), wrap_button);
 
         gtk_widget_set_hexpand(w, TRUE);
         gtk_widget_set_halign(w, GTK_ALIGN_FILL);
-       gtk_box_pack_start(GTK_BOX(box), w, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(box), w);
 
        button = gtk_button_new_with_mnemonic(_("_OK"));
        g_signal_connect(button, "clicked",
diff --git a/src/message-window.c b/src/message-window.c
index e923a4617..1e9be203f 100644
--- a/src/message-window.c
+++ b/src/message-window.c
@@ -868,7 +868,7 @@ message_window_new(LibBalsaMailbox * mailbox, guint msgno)
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu(window, GTK_MENU_SHELL(menubar));
 #else
-    gtk_box_pack_start(GTK_BOX(vbox), menubar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), menubar);
 #endif
 
     mw->headers_shown = balsa_app.shown_headers;
@@ -877,7 +877,7 @@ message_window_new(LibBalsaMailbox * mailbox, guint msgno)
     model = message_window_get_toolbar_model();
 
     mw->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
-    gtk_box_pack_start(GTK_BOX(vbox), mw->toolbar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), mw->toolbar);
 
     gtk_window_set_role(GTK_WINDOW(window), "message");
 
diff --git a/src/pref-manager.c b/src/pref-manager.c
index 16645c041..8296cb2ff 100644
--- a/src/pref-manager.c
+++ b/src/pref-manager.c
@@ -1010,7 +1010,7 @@ add_button_to_box(const gchar * label, GCallback cb, gpointer cb_data,
 {
     GtkWidget *button = gtk_button_new_with_mnemonic(label);
     g_signal_connect_swapped(button, "clicked", cb, cb_data);
-    gtk_box_pack_start(GTK_BOX(box), button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), button);
 
     return button;
 }
@@ -2156,22 +2156,19 @@ pm_grid_add_checking_group(GtkWidget * grid_widget)
 
     label = gtk_label_new(_("When mail arrives:"));
     gtk_widget_set_halign(label, GTK_ALIGN_START);
-    gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), label);
 
     pui->notify_new_mail_dialog =
         gtk_check_button_new_with_label(_("Display message"));
-    gtk_box_pack_start(GTK_BOX(hbox), pui->notify_new_mail_dialog,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), pui->notify_new_mail_dialog);
 
     pui->notify_new_mail_sound =
         gtk_check_button_new_with_label(_("Play sound"));
-    gtk_box_pack_start(GTK_BOX(hbox), pui->notify_new_mail_sound,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), pui->notify_new_mail_sound);
 
     pui->notify_new_mail_icon =
         gtk_check_button_new_with_label(_("Show icon"));
-    gtk_box_pack_start(GTK_BOX(hbox), pui->notify_new_mail_icon,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), pui->notify_new_mail_icon);
 
     pm_grid_attach(grid, hbox, 1, ++row, 3, 1);
 
diff --git a/src/print-gtk.c b/src/print-gtk.c
index 421191dfc..449d9db32 100644
--- a/src/print-gtk.c
+++ b/src/print-gtk.c
@@ -555,10 +555,10 @@ create_options_group(const gchar *label_str, GtkWidget *parent_grid, gint parent
     markup = g_strdup_printf("<b>%s</b>", label_str);
     label = libbalsa_create_wrap_label(markup, TRUE);
     g_free(markup);
-    gtk_box_pack_start(GTK_BOX(group), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(group), label);
 
        grid = gtk_grid_new();
-    gtk_box_pack_start(GTK_BOX(group), grid, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(group), grid);
        gtk_grid_set_column_spacing(GTK_GRID(grid), 0);
        gtk_grid_set_row_spacing(GTK_GRID(grid), 6);
        gtk_grid_attach(GTK_GRID(grid), gtk_label_new("    "), 0, 0, 1, 1);
diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 85b0d6b1f..a5de60f81 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -1492,14 +1492,14 @@ sw_get_user_codeset(BalsaSendmsg * bsmsg, gboolean * change_type,
          fname);
     GtkWidget *info = gtk_label_new(msg);
     GtkWidget *charset_button = libbalsa_charset_button_new();
-    GtkBox *content_box;
+    GtkWidget *content_box;
 
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu_for_parent(dialog, GTK_WINDOW(bsmsg->window));
 #endif
 
     g_free(msg);
-    content_box = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
+    content_box = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
 
     gtk_widget_set_margin_top(info, 5);
     gtk_widget_set_margin_bottom(info, 5);
@@ -3351,7 +3351,7 @@ quote_parts_select_dlg(GtkTreeStore               *tree_store,
     GtkCellRenderer *renderer;
     GtkTreeIter iter;
     gboolean result;
-    GtkBox *content_box;
+    GtkWidget *content_box;
 
     dialog = gtk_dialog_new_with_buttons(_("Select parts for quotation"),
                                         parent,
@@ -3377,17 +3377,17 @@ quote_parts_select_dlg(GtkTreeStore               *tree_store,
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
 
-    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
-    gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(vbox), label);
+    gtk_container_add(GTK_CONTAINER(hbox), image);
 
     gtk_widget_set_hexpand(vbox, TRUE);
     gtk_widget_set_halign(vbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), vbox);
 
-    content_box = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
+    content_box = gtk_dialog_get_content_area(GTK_DIALOG(dialog));
     gtk_widget_set_vexpand(hbox, TRUE);
     gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(content_box, hbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_box), hbox);
 
     if (stats->decrypted > 0U) {
        GtkWidget *warning;
@@ -3407,12 +3407,12 @@ quote_parts_select_dlg(GtkTreeStore               *tree_store,
                          "unintentionally leak sensitive information."), FALSE);
        }
         gtk_widget_set_valign(warning, GTK_ALIGN_START);
-        gtk_box_pack_start(GTK_BOX(vbox), warning, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(vbox), warning);
     }
 
     gtk_container_set_border_width(GTK_CONTAINER(dialog), 5);
     gtk_container_set_border_width(GTK_CONTAINER(hbox), 5);
-    gtk_box_set_spacing(content_box, 14);
+    gtk_box_set_spacing(GTK_BOX(content_box), 14);
 
     /* scrolled window for the tree view */
     scroll = gtk_scrolled_window_new(NULL, NULL);
@@ -3485,7 +3485,7 @@ show_decrypted_warning(GtkWindow *parent)
        remind_btn = gtk_check_button_new_with_label(_("Do not remind me again."));
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(remind_btn), FALSE);
        gtk_widget_show(remind_btn);
-       gtk_box_pack_end(GTK_BOX(message_area), remind_btn, FALSE, FALSE, 0);
+       gtk_container_add(GTK_CONTAINER(message_area), remind_btn);
        gtk_dialog_run(GTK_DIALOG(dialog));
        balsa_app.warn_reply_decrypted = !gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(remind_btn));
        gtk_widget_destroy(dialog);
@@ -5144,32 +5144,32 @@ subject_not_empty(BalsaSendmsg * bsmsg)
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
     gtk_widget_set_vexpand(hbox, TRUE);
     gtk_widget_set_valign(hbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(dialog_vbox), hbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(dialog_vbox), hbox);
     gtk_container_set_border_width (GTK_CONTAINER (hbox), 6);
 
     image = gtk_image_new_from_icon_name("dialog-question",
                                          GTK_ICON_SIZE_DIALOG);
-    gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER (hbox), image);
     gtk_widget_set_valign(image, GTK_ALIGN_START);
 
     vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 12);
     gtk_widget_set_hexpand(vbox, TRUE);
     gtk_widget_set_halign(vbox, GTK_ALIGN_FILL);
-    gtk_box_pack_start(GTK_BOX(hbox), vbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), vbox);
 
     text_str = g_strdup_printf("<span weight=\"bold\" size=\"larger\">%s</span>\n\n%s",
                               _("You did not specify a subject for this message"),
                               _("If you would like to provide one, enter it below."));
     label = libbalsa_create_wrap_label(text_str, TRUE);
     g_free(text_str);
-    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER (vbox), label);
     gtk_widget_set_valign(label, GTK_ALIGN_START);
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 6);
-    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER (vbox), hbox);
 
     label = gtk_label_new (_("Subject:"));
-    gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER (hbox), label);
 
     subj_entry = gtk_entry_new ();
     gtk_entry_set_text(GTK_ENTRY(subj_entry), _("(no subject)"));
@@ -6887,7 +6887,7 @@ sendmsg_window_new()
 #if HAVE_MACOSX_DESKTOP
     libbalsa_macosx_menu(window, GTK_MENU_SHELL(menubar));
 #else
-    gtk_box_pack_start(GTK_BOX(main_box), menubar, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(main_box), menubar);
 #endif
 
     /*
@@ -6903,8 +6903,7 @@ sendmsg_window_new()
 
     model = sendmsg_window_get_toolbar_model();
     bsmsg->toolbar = balsa_toolbar_new(model, G_ACTION_MAP(window));
-    gtk_box_pack_start(GTK_BOX(main_box), bsmsg->toolbar,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(main_box), bsmsg->toolbar);
 
     bsmsg->flow = !balsa_app.wordwrap;
     sw_action_set_enabled(bsmsg, "reflow", bsmsg->flow);
diff --git a/src/spell-check.c b/src/spell-check.c
index a54072159..207dc7795 100644
--- a/src/spell-check.c
+++ b/src/spell-check.c
@@ -295,8 +295,7 @@ balsa_spell_check_init(BalsaSpellCheck *spell_check)
     GtkCellRenderer *renderer;
     GtkTreeViewColumn *column;
     GtkTreeSelection *selection;
-    GtkWidget *box_widget;
-    GtkBox *box;
+    GtkWidget *box;
 
     /* Set spell checker */
 
@@ -308,12 +307,10 @@ balsa_spell_check_init(BalsaSpellCheck *spell_check)
     /* setup suggestion display */
     widget             = gtk_entry_new();
     spell_check->entry = GTK_ENTRY(widget);
-    box_widget         =
-        gtk_box_new(GTK_ORIENTATION_VERTICAL, BALSA_SPELL_CHECK_PADDING);
-    gtk_container_add((GtkContainer *) spell_check, box_widget);
+    box = gtk_box_new(GTK_ORIENTATION_VERTICAL, BALSA_SPELL_CHECK_PADDING);
+    gtk_container_add(GTK_CONTAINER(spell_check), box);
 
-    box = (GtkBox *) box_widget;
-    gtk_box_pack_start(box, widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), widget);
 
     sw = gtk_scrolled_window_new(NULL, NULL);
     gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
@@ -345,7 +342,7 @@ balsa_spell_check_init(BalsaSpellCheck *spell_check)
 
     /* setup buttons to perform actions */
     widget = gtk_grid_new();
-    gtk_box_pack_start(box, widget, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(box), widget);
 
     grid = GTK_GRID(widget);
     gtk_grid_set_row_spacing(grid, BALSA_SPELL_CHECK_PADDING);
diff --git a/src/store-address.c b/src/store-address.c
index 5ed347810..2bf30e7ce 100644
--- a/src/store-address.c
+++ b/src/store-address.c
@@ -222,7 +222,7 @@ store_address_dialog(StoreAddressInfo * info)
         /* User has more than one address book, so show the options */
         frame = store_address_book_frame(info);
         gtk_widget_show_all(frame);
-        gtk_box_pack_start(GTK_BOX(vbox), frame, FALSE, FALSE, 0);
+        gtk_container_add(GTK_CONTAINER(vbox), frame);
     }
 
     frame = store_address_note_frame(info);
@@ -290,8 +290,7 @@ store_address_book_frame(StoreAddressInfo * info)
 
     hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
     gtk_container_set_border_width(GTK_CONTAINER(hbox), 4);
-    gtk_box_pack_start(GTK_BOX(hbox), gtk_label_new(_("Address Book:")),
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(hbox), gtk_label_new(_("Address Book:")));
 
     combo_box = gtk_combo_box_text_new();
     g_signal_connect(combo_box, "changed",
diff --git a/src/toolbar-prefs.c b/src/toolbar-prefs.c
index 55ce1c88c..818684a52 100644
--- a/src/toolbar-prefs.c
+++ b/src/toolbar-prefs.c
@@ -177,7 +177,7 @@ balsa_toolbar_customize(GtkWindow * active_window, BalsaToolbarType type)
 
     option_frame = gtk_frame_new(_("Toolbar options"));
     gtk_container_set_border_width(GTK_CONTAINER(option_frame), 6);
-    gtk_box_pack_start(GTK_BOX(content_area), option_frame, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(content_area), option_frame);
 
     option_box = gtk_box_new(GTK_ORIENTATION_VERTICAL, 6);
     gtk_container_set_border_width(GTK_CONTAINER(option_box), 6);
@@ -189,7 +189,7 @@ balsa_toolbar_customize(GtkWindow * active_window, BalsaToolbarType type)
                                  balsa_app.toolbar_wrap_button_text);
     g_signal_connect(wrap_button, "toggled",
                      G_CALLBACK(wrap_toggled_cb), notebook);
-    gtk_box_pack_start(GTK_BOX(option_box), wrap_button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(option_box), wrap_button);
 
     gtk_widget_show_all(customize_widget);
 
@@ -411,7 +411,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     /* Button box */
     button_box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
     gtk_box_set_spacing(GTK_BOX(button_box), 5);
-    gtk_box_pack_start(GTK_BOX(toolbar_ctlbox), button_box, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(toolbar_ctlbox), button_box);
 
     /* Standard button */
     page->standard_button =
@@ -441,8 +441,7 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
     list_frame=gtk_frame_new(_("Available buttons"));
     page->available = tp_list_new();
 
-    gtk_box_pack_start(GTK_BOX(lower_ctlbox), list_frame,
-                      TRUE, TRUE, 0);
+    gtk_container_add(GTK_CONTAINER(lower_ctlbox), list_frame);
     gtk_container_add(GTK_CONTAINER(list_frame), list_scroll);
     gtk_container_add(GTK_CONTAINER(list_scroll), page->available);
 
@@ -465,43 +464,40 @@ create_toolbar_page(BalsaToolbarModel * model, GActionMap * map)
 
     button_box=gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
 
-    gtk_box_pack_start(GTK_BOX(lower_ctlbox), center_button_box,
-                      FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(lower_ctlbox), center_button_box);
 
-    gtk_box_pack_start(GTK_BOX(center_button_box), button_box,
-                      FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(center_button_box), button_box);
 
     page->back_button =
         gtk_button_new_from_icon_name("go-up-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_tooltip_text(page->back_button,
                                 _("Move selected item up"));
-    gtk_box_pack_start(GTK_BOX(button_box), page->back_button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(button_box), page->back_button);
 
     move_button_box=gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0);
-    gtk_box_pack_start(GTK_BOX(button_box), move_button_box, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(button_box), move_button_box);
 
     page->remove_button =
         gtk_button_new_from_icon_name("go-previous-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_tooltip_text(page->remove_button,
                                 _("Remove selected item from toolbar"));
-    gtk_box_pack_start(GTK_BOX(move_button_box), page->remove_button,
-                       FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(move_button_box), page->remove_button);
 
     page->add_button =
         gtk_button_new_from_icon_name("go-next-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_tooltip_text(page->add_button,
                                 _("Add selected item to toolbar"));
-    gtk_box_pack_start(GTK_BOX(move_button_box), page->add_button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(move_button_box), page->add_button);
 
     page->forward_button =
         gtk_button_new_from_icon_name("go-down-symbolic",
                                       GTK_ICON_SIZE_BUTTON);
     gtk_widget_set_tooltip_text(page->forward_button,
                                 _("Move selected item down"));
-    gtk_box_pack_start(GTK_BOX(button_box), page->forward_button, FALSE, FALSE, 0);
+    gtk_container_add(GTK_CONTAINER(button_box), page->forward_button);
 
     /* Pack destination list */
     gtk_widget_set_hexpand(destination_frame, TRUE);


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