From 448c5f320851296c4d26df8eeec7d2d51c82f2b5 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 23 Nov 2021 05:16:05 +0200 Subject: [PATCH 39/39] gtk3x: Avoid gtk_widget_destroy() on removal of cma shell See osdn #43263 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/citydlg.c | 6 ++---- client/gui-gtk-4.0/cma_fe.c | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index a9bb297adc..d12aac3715 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -1367,17 +1367,15 @@ static void create_and_append_cma_page(struct city_dialog *pdialog) { GtkWidget *page, *label; const char *tab_title = _("_Governor"); - int page_col = 0; - page = gtk_grid_new(); + page = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); label = gtk_label_new_with_mnemonic(tab_title); gtk_notebook_append_page(GTK_NOTEBOOK(pdialog->notebook), page, label); pdialog->cma_editor = create_cma_dialog(pdialog->pcity, low_citydlg); - gtk_grid_attach(GTK_GRID(page), pdialog->cma_editor->shell, - page_col++, 0, 1, 1); + gtk_box_append(GTK_BOX(page), pdialog->cma_editor->shell); gtk_widget_show(page); } diff --git a/client/gui-gtk-4.0/cma_fe.c b/client/gui-gtk-4.0/cma_fe.c index c6904774e2..7c1568c620 100644 --- a/client/gui-gtk-4.0/cma_fe.c +++ b/client/gui-gtk-4.0/cma_fe.c @@ -109,7 +109,9 @@ void close_cma_dialog(struct city *pcity) /* A city which is being investigated doesn't contain cma dialog */ return; } - gtk_widget_destroy(pdialog->shell); + + gtk_box_remove(GTK_BOX(gtk_widget_get_parent(pdialog->shell)), + pdialog->shell); } /**********************************************************************//** -- 2.33.0