From 9858d32cb6c695966dd9fd332aaae6753426c817 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 16 Nov 2021 17:17:19 +0200 Subject: [PATCH 35/35] gtk3x: Fix adding widgets to horizontal gui_dialog Rename variables and functions to agnostic to orientation. See osdn #43225 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/cityrep.c | 2 +- client/gui-gtk-4.0/dialogs.c | 2 +- client/gui-gtk-4.0/diplodlg.c | 10 ++--- client/gui-gtk-4.0/finddlg.c | 8 ++-- client/gui-gtk-4.0/gui_stuff.c | 64 +++++++++++++++++-------------- client/gui-gtk-4.0/gui_stuff.h | 8 ++-- client/gui-gtk-4.0/luaconsole.c | 2 +- client/gui-gtk-4.0/messagedlg.c | 4 +- client/gui-gtk-4.0/messagewin.c | 2 +- client/gui-gtk-4.0/plrdlg.c | 2 +- client/gui-gtk-4.0/repodlgs.c | 16 ++++---- client/gui-gtk-4.0/spaceshipdlg.c | 4 +- 12 files changed, 67 insertions(+), 57 deletions(-) diff --git a/client/gui-gtk-4.0/cityrep.c b/client/gui-gtk-4.0/cityrep.c index 92a3d752a1..509764ce8d 100644 --- a/client/gui-gtk-4.0/cityrep.c +++ b/client/gui-gtk-4.0/cityrep.c @@ -1243,7 +1243,7 @@ static void create_city_report_dialog(bool make_modal) GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add(GTK_CONTAINER(sw), city_view); - gui_dialog_vgrid_add(city_dialog_shell, sw); + gui_dialog_add_content_widget(city_dialog_shell, sw); city_model_fill(city_model, NULL, NULL); gui_dialog_show_all(city_dialog_shell); diff --git a/client/gui-gtk-4.0/dialogs.c b/client/gui-gtk-4.0/dialogs.c index 13ec07e98a..db8a2c619e 100644 --- a/client/gui-gtk-4.0/dialogs.c +++ b/client/gui-gtk-4.0/dialogs.c @@ -115,7 +115,7 @@ void popup_notify_dialog(const char *caption, const char *headline, gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); gtk_grid_set_row_spacing(GTK_GRID(vbox), 2); - gui_dialog_vgrid_add(shell, vbox); + gui_dialog_add_content_widget(shell, vbox); headline_label = gtk_label_new(headline); gtk_container_add(GTK_CONTAINER(vbox), headline_label); diff --git a/client/gui-gtk-4.0/diplodlg.c b/client/gui-gtk-4.0/diplodlg.c index f0e9c1e6b8..a0f5216da7 100644 --- a/client/gui-gtk-4.0/diplodlg.c +++ b/client/gui-gtk-4.0/diplodlg.c @@ -510,7 +510,7 @@ static struct Diplomacy_notebook *diplomacy_main_create(void) gui_dialog_response_set_callback(dipl_main->dialog, diplomacy_main_response); - gui_dialog_vgrid_add(dipl_main->dialog, dipl_sw); + gui_dialog_add_content_widget(dipl_main->dialog, dipl_sw); gui_dialog_show_all(dipl_main->dialog); gui_dialog_present(dipl_main->dialog); @@ -681,7 +681,7 @@ static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, if (fc_strcasecmp(buf, prev_label) < 0) { gtk_notebook_reorder_child(GTK_NOTEBOOK(notebook), - pdialog->dialog->vgrid, i); + pdialog->dialog->grid, i); break; } } @@ -696,7 +696,7 @@ static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, gtk_widget_set_margin_end(vbox, 2); gtk_widget_set_margin_top(vbox, 2); gtk_widget_set_margin_bottom(vbox, 2); - gui_dialog_vgrid_add(pdialog->dialog, vbox); + gui_dialog_add_content_widget(pdialog->dialog, vbox); /* Our nation. */ label = gtk_label_new(NULL); @@ -783,7 +783,7 @@ static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, gtk_widget_set_margin_end(vbox, 2); gtk_widget_set_margin_top(vbox, 2); gtk_widget_set_margin_bottom(vbox, 2); - gui_dialog_vgrid_add(pdialog->dialog, vbox); + gui_dialog_add_content_widget(pdialog->dialog, vbox); /* Their nation. */ label = gtk_label_new(NULL); @@ -865,7 +865,7 @@ static struct Diplomacy_dialog *create_diplomacy_dialog(struct player *plr0, mainbox = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(mainbox), GTK_ORIENTATION_VERTICAL); - gui_dialog_vgrid_add(pdialog->dialog, mainbox); + gui_dialog_add_content_widget(pdialog->dialog, mainbox); store = gtk_list_store_new(1, G_TYPE_STRING); pdialog->store = store; diff --git a/client/gui-gtk-4.0/finddlg.c b/client/gui-gtk-4.0/finddlg.c index fe665536a6..e40cd1bcbc 100644 --- a/client/gui-gtk-4.0/finddlg.c +++ b/client/gui-gtk-4.0/finddlg.c @@ -79,8 +79,8 @@ void popup_find_dialog(void) gui_dialog_response_set_callback(find_dialog_shell, find_response); - g_signal_connect(find_dialog_shell->vgrid, "destroy", - G_CALLBACK(find_destroy_callback), NULL); + g_signal_connect(find_dialog_shell->grid, "destroy", + G_CALLBACK(find_destroy_callback), NULL); store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_POINTER); gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(store), @@ -113,8 +113,8 @@ void popup_find_dialog(void) "mnemonic-widget", find_view, "label", _("Ci_ties:"), "xalign", 0.0, "yalign", 0.5, NULL); - gui_dialog_vgrid_add(find_dialog_shell, label); - gui_dialog_vgrid_add(find_dialog_shell, sw); + gui_dialog_add_content_widget(find_dialog_shell, label); + gui_dialog_add_content_widget(find_dialog_shell, sw); g_signal_connect(selection, "changed", G_CALLBACK(find_selection_callback), store); diff --git a/client/gui-gtk-4.0/gui_stuff.c b/client/gui-gtk-4.0/gui_stuff.c index 4fa08c2263..aff2e4890d 100644 --- a/client/gui-gtk-4.0/gui_stuff.c +++ b/client/gui-gtk-4.0/gui_stuff.c @@ -422,7 +422,7 @@ static void gui_dialog_switch_page_handler(GtkNotebook *notebook, { gint n; - n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->vgrid); + n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid); if (n == num) { GtkStyleContext *context = gtk_widget_get_style_context(dlg->v.tab.label); @@ -448,14 +448,14 @@ static void gui_dialog_detach(struct gui_dialog* dlg) /* Create a new reference to the main widget, so it won't be * destroyed in gtk_notebook_remove_page() */ - g_object_ref(dlg->vgrid); + g_object_ref(dlg->grid); /* Remove widget from the notebook */ notebook = dlg->v.tab.notebook; handler_id = dlg->v.tab.handler_id; g_signal_handler_disconnect(notebook, handler_id); - n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->vgrid); + n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid); gtk_notebook_remove_page(GTK_NOTEBOOK(dlg->v.tab.notebook), n); @@ -464,7 +464,7 @@ static void gui_dialog_detach(struct gui_dialog* dlg) gtk_window_set_title(GTK_WINDOW(window), dlg->title); setup_dialog(window, toplevel); - gtk_container_add(GTK_CONTAINER(window), dlg->vgrid); + gtk_container_add(GTK_CONTAINER(window), dlg->grid); dlg->v.window = window; g_signal_connect(window, "close-request", G_CALLBACK(gui_dialog_delete_handler), dlg); @@ -537,8 +537,8 @@ void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, } dlg->gui_button = gtk_size_group_new(GTK_SIZE_GROUP_BOTH); - dlg->vgrid = gtk_grid_new(); - dlg->row = 0; + dlg->grid = gtk_grid_new(); + dlg->content_counter = 0; action_area = gtk_grid_new(); gtk_grid_set_row_spacing(GTK_GRID(action_area), 4); gtk_grid_set_column_spacing(GTK_GRID(action_area), 4); @@ -549,21 +549,23 @@ void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, * height by putting buttons down the right hand side */ gtk_orientable_set_orientation(GTK_ORIENTABLE(action_area), GTK_ORIENTATION_VERTICAL); + dlg->vertical_content = FALSE; } else { /* We expect this to be reasonably tall; maximise usable width by * putting buttons along the bottom */ - gtk_orientable_set_orientation(GTK_ORIENTABLE(dlg->vgrid), + gtk_orientable_set_orientation(GTK_ORIENTABLE(dlg->grid), GTK_ORIENTATION_VERTICAL); + dlg->vertical_content = TRUE; } - gtk_widget_show(dlg->vgrid); - gui_dialog_vgrid_add(dlg, action_area); + gtk_widget_show(dlg->grid); + gui_dialog_add_content_widget(dlg, action_area); gtk_widget_show(action_area); - gtk_widget_set_margin_start(dlg->vgrid, 2); - gtk_widget_set_margin_end(dlg->vgrid, 2); - gtk_widget_set_margin_top(dlg->vgrid, 2); - gtk_widget_set_margin_bottom(dlg->vgrid, 2); + gtk_widget_set_margin_start(dlg->grid, 2); + gtk_widget_set_margin_end(dlg->grid, 2); + gtk_widget_set_margin_top(dlg->grid, 2); + gtk_widget_set_margin_bottom(dlg->grid, 2); gtk_widget_set_margin_start(action_area, 2); gtk_widget_set_margin_end(action_area, 2); @@ -579,7 +581,7 @@ void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gtk_widget_set_name(window, "Freeciv"); setup_dialog(window, toplevel); - gtk_container_add(GTK_CONTAINER(window), dlg->vgrid); + gtk_container_add(GTK_CONTAINER(window), dlg->grid); dlg->v.window = window; g_signal_connect(window, "close-request", G_CALLBACK(gui_dialog_delete_handler), dlg); @@ -617,11 +619,11 @@ void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, gtk_widget_show(hbox); - gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dlg->vgrid, hbox); + gtk_notebook_append_page(GTK_NOTEBOOK(notebook), dlg->grid, hbox); dlg->v.tab.handler_id = g_signal_connect(notebook, "switch-page", G_CALLBACK(gui_dialog_switch_page_handler), dlg); - dlg->v.tab.child = dlg->vgrid; + dlg->v.tab.child = dlg->grid; gtk_style_context_add_provider(gtk_widget_get_style_context(label), GTK_STYLE_PROVIDER(dlg_tab_provider), @@ -643,12 +645,12 @@ void gui_dialog_new(struct gui_dialog **pdlg, GtkNotebook *notebook, dialog_id_counter++; dlg->return_dialog_id = -1; - g_signal_connect(dlg->vgrid, "destroy", + g_signal_connect(dlg->grid, "destroy", G_CALLBACK(gui_dialog_destroy_handler), dlg); - g_signal_connect(dlg->vgrid, "key_press_event", + g_signal_connect(dlg->grid, "key_press_event", G_CALLBACK(gui_dialog_key_press_handler), dlg); - g_object_set_data(G_OBJECT(dlg->vgrid), "gui-dialog-data", dlg); + g_object_set_data(G_OBJECT(dlg->grid), "gui-dialog-data", dlg); } /**********************************************************************//** @@ -681,7 +683,7 @@ static void gui_dialog_pack_button(struct gui_dialog *dlg, GtkWidget *button, GClosure *closure; closure = g_cclosure_new_object(G_CALLBACK(action_widget_activated), - G_OBJECT(dlg->vgrid)); + G_OBJECT(dlg->grid)); g_signal_connect_closure_by_id(button, signal_id, 0, closure, FALSE); } @@ -749,7 +751,7 @@ void gui_dialog_set_response_sensitive(struct gui_dialog *dlg, **************************************************************************/ GtkWidget *gui_dialog_get_toplevel(struct gui_dialog *dlg) { - return gtk_widget_get_ancestor(dlg->vgrid, GTK_TYPE_WINDOW); + return gtk_widget_get_ancestor(dlg->grid, GTK_TYPE_WINDOW); } /**********************************************************************//** @@ -757,7 +759,7 @@ GtkWidget *gui_dialog_get_toplevel(struct gui_dialog *dlg) **************************************************************************/ void gui_dialog_show_all(struct gui_dialog *dlg) { - gtk_widget_show(dlg->vgrid); + gtk_widget_show(dlg->grid); if (dlg->type == GUI_DIALOG_TAB) { GList *children; @@ -809,7 +811,7 @@ void gui_dialog_present(struct gui_dialog *dlg) gint current, n; current = gtk_notebook_get_current_page(notebook); - n = gtk_notebook_page_num(notebook, dlg->vgrid); + n = gtk_notebook_page_num(notebook, dlg->grid); if (current != n) { GtkWidget *label = dlg->v.tab.label; @@ -838,7 +840,7 @@ void gui_dialog_raise(struct gui_dialog *dlg) GtkNotebook *notebook = GTK_NOTEBOOK(dlg->v.tab.notebook); gint n; - n = gtk_notebook_page_num(notebook, dlg->vgrid); + n = gtk_notebook_page_num(notebook, dlg->grid); gtk_notebook_set_current_page(notebook, n); } break; @@ -861,7 +863,7 @@ void gui_dialog_alert(struct gui_dialog *dlg) gint current, n; current = gtk_notebook_get_current_page(notebook); - n = gtk_notebook_page_num(notebook, dlg->vgrid); + n = gtk_notebook_page_num(notebook, dlg->grid); if (current != n) { GtkWidget *label = dlg->v.tab.label; @@ -924,7 +926,7 @@ void gui_dialog_destroy(struct gui_dialog *dlg) { gint n; - n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->vgrid); + n = gtk_notebook_page_num(GTK_NOTEBOOK(dlg->v.tab.notebook), dlg->grid); gtk_notebook_remove_page(GTK_NOTEBOOK(dlg->v.tab.notebook), n); } break; @@ -1127,7 +1129,13 @@ void dlg_tab_provider_prepare(void) /**********************************************************************//** Add widget to the gui_dialog vgrid **************************************************************************/ -void gui_dialog_vgrid_add(struct gui_dialog *dlg, GtkWidget *wdg) +void gui_dialog_add_content_widget(struct gui_dialog *dlg, GtkWidget *wdg) { - gtk_grid_attach(GTK_GRID(dlg->vgrid), wdg, 0, dlg->row++, 1, 1); + if (dlg->vertical_content) { + gtk_grid_attach(GTK_GRID(dlg->grid), wdg, + 0, dlg->content_counter++, 1, 1); + } else { + gtk_grid_attach(GTK_GRID(dlg->grid), wdg, + dlg->content_counter++, 0, 1, 1); + } } diff --git a/client/gui-gtk-4.0/gui_stuff.h b/client/gui-gtk-4.0/gui_stuff.h index 37bc0cf80e..f2e2fddf98 100644 --- a/client/gui-gtk-4.0/gui_stuff.h +++ b/client/gui-gtk-4.0/gui_stuff.h @@ -68,7 +68,7 @@ typedef void (*GUI_DIALOG_RESPONSE_FUN)(struct gui_dialog *, int, gpointer); struct gui_dialog { /* public. */ - GtkWidget *vgrid; + GtkWidget *grid; GtkWidget *action_area; /* private. */ @@ -80,7 +80,8 @@ struct gui_dialog int default_width; int default_height; - int row; + bool vertical_content; + int content_counter; union { GtkWidget *window; @@ -109,7 +110,8 @@ GtkWidget *gui_dialog_add_button(struct gui_dialog *dlg, const char *text, int response); GtkWidget *gui_dialog_add_widget(struct gui_dialog *dlg, GtkWidget *widget); -void gui_dialog_vgrid_add(struct gui_dialog *dlg, GtkWidget *wdg); +void gui_dialog_add_content_widget(struct gui_dialog *dlg, + GtkWidget *wdg); void gui_dialog_set_default_size(struct gui_dialog *dlg, int width, int height); void gui_dialog_set_title(struct gui_dialog *dlg, const char *title); diff --git a/client/gui-gtk-4.0/luaconsole.c b/client/gui-gtk-4.0/luaconsole.c index 3cb2976e31..1939fc6a6c 100644 --- a/client/gui-gtk-4.0/luaconsole.c +++ b/client/gui-gtk-4.0/luaconsole.c @@ -198,7 +198,7 @@ static void luaconsole_dialog_create(struct luaconsole_data *pdialog) vbox = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), GTK_ORIENTATION_VERTICAL); - gui_dialog_vgrid_add(pdialog->shell, vbox); + gui_dialog_add_content_widget(pdialog->shell, vbox); sw = gtk_scrolled_window_new(); gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE); diff --git a/client/gui-gtk-4.0/messagedlg.c b/client/gui-gtk-4.0/messagedlg.c index da461659fa..62ae41b4d7 100644 --- a/client/gui-gtk-4.0/messagedlg.c +++ b/client/gui-gtk-4.0/messagedlg.c @@ -81,11 +81,11 @@ static void create_messageopt_dialog(void) "Messages window ; " "Popup individual window")); gtk_widget_set_name(explanation, "comment_label"); - gui_dialog_vgrid_add(shell, explanation); + gui_dialog_add_content_widget(shell, explanation); gtk_widget_show(explanation); form = gtk_grid_new(); - gui_dialog_vgrid_add(shell, form); + gui_dialog_add_content_widget(shell, form); for (n = 0; n < NUM_LISTS; n++) { models[n] = gtk_list_store_new(5, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, diff --git a/client/gui-gtk-4.0/messagewin.c b/client/gui-gtk-4.0/messagewin.c index a26d8e965f..f3baa78e3e 100644 --- a/client/gui-gtk-4.0/messagewin.c +++ b/client/gui-gtk-4.0/messagewin.c @@ -343,7 +343,7 @@ static void meswin_dialog_init(struct meswin_dialog *pdialog) gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gui_dialog_vgrid_add(pdialog->shell, sw); + gui_dialog_add_content_widget(pdialog->shell, sw); store = meswin_dialog_store_new(); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); diff --git a/client/gui-gtk-4.0/plrdlg.c b/client/gui-gtk-4.0/plrdlg.c index d08f31330f..901326b7a1 100644 --- a/client/gui-gtk-4.0/plrdlg.c +++ b/client/gui-gtk-4.0/plrdlg.c @@ -572,7 +572,7 @@ void create_players_dialog(void) GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); gtk_container_add(GTK_CONTAINER(sw), players_list); - gui_dialog_vgrid_add(players_dialog_shell, sw); + gui_dialog_add_content_widget(players_dialog_shell, sw); vbox = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(vbox), diff --git a/client/gui-gtk-4.0/repodlgs.c b/client/gui-gtk-4.0/repodlgs.c index 30e9963ad9..7e7964d39f 100644 --- a/client/gui-gtk-4.0/repodlgs.c +++ b/client/gui-gtk-4.0/repodlgs.c @@ -565,12 +565,12 @@ static void science_report_init(struct science_report *preport) group = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL); w = gtk_label_new(NULL); - gui_dialog_vgrid_add(preport->shell, w); + gui_dialog_add_content_widget(preport->shell, w); preport->main_label = GTK_LABEL(w); /* Current research target line. */ frame = gtk_frame_new(_("Researching")); - gui_dialog_vgrid_add(preport->shell, frame); + gui_dialog_add_content_widget(preport->shell, frame); table = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(table), 4); @@ -602,7 +602,7 @@ static void science_report_init(struct science_report *preport) /* Research goal line. */ frame = gtk_frame_new( _("Goal")); - gui_dialog_vgrid_add(preport->shell, frame); + gui_dialog_add_content_widget(preport->shell, frame); table = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(table), 4); @@ -646,7 +646,7 @@ static void science_report_init(struct science_report *preport) sw = gtk_scrolled_window_new(); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gui_dialog_vgrid_add(preport->shell, sw); + gui_dialog_add_content_widget(preport->shell, sw); w = science_diagram_new(); gtk_widget_set_hexpand(w, TRUE); @@ -1098,7 +1098,7 @@ static void economy_report_init(struct economy_report *preport) gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gui_dialog_vgrid_add(preport->shell, sw); + gui_dialog_add_content_widget(preport->shell, sw); store = economy_report_store_new(); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); @@ -1153,7 +1153,7 @@ static void economy_report_init(struct economy_report *preport) } label = gtk_label_new(NULL); - gui_dialog_vgrid_add(preport->shell, label); + gui_dialog_add_content_widget(preport->shell, label); gtk_widget_set_margin_start(label, 5); gtk_widget_set_margin_end(label, 5); gtk_widget_set_margin_top(label, 5); @@ -1629,7 +1629,7 @@ static void units_report_init(struct units_report *preport) gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); - gui_dialog_vgrid_add(preport->shell, sw); + gui_dialog_add_content_widget(preport->shell, sw); store = units_report_store_new(); view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)); @@ -1909,7 +1909,7 @@ static void endgame_report_init(struct endgame_report *preport) gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(sw), TRUE); gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS); - gui_dialog_vgrid_add(preport->shell, sw); + gui_dialog_add_content_widget(preport->shell, sw); view = gtk_tree_view_new(); gtk_widget_set_name(view, "small_font"); diff --git a/client/gui-gtk-4.0/spaceshipdlg.c b/client/gui-gtk-4.0/spaceshipdlg.c index 0d29e45a1f..1481fca445 100644 --- a/client/gui-gtk-4.0/spaceshipdlg.c +++ b/client/gui-gtk-4.0/spaceshipdlg.c @@ -232,13 +232,13 @@ struct spaceship_dialog *create_spaceship_dialog(struct player *pplayer) gui_dialog_add_button(pdialog->shell, NULL, _("_Launch"), GTK_RESPONSE_ACCEPT); - g_signal_connect(pdialog->shell->vgrid, "destroy", + g_signal_connect(pdialog->shell->grid, "destroy", G_CALLBACK(spaceship_destroy_callback), pdialog); gui_dialog_response_set_callback(pdialog->shell, spaceship_response); hbox = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(hbox), 5); - gui_dialog_vgrid_add(pdialog->shell, hbox); + gui_dialog_add_content_widget(pdialog->shell, hbox); frame = gtk_frame_new(NULL); gtk_container_add(GTK_CONTAINER(hbox), frame); -- 2.33.0