[gtk/kill-buttonbox] Drop GtkButtonBox
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/kill-buttonbox] Drop GtkButtonBox
- Date: Mon, 4 Feb 2019 17:47:13 +0000 (UTC)
commit 51207489813ebef7f143dcded70fab4a3edff612
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Feb 4 12:44:55 2019 -0500
Drop GtkButtonBox
This widget does not seem worth keeping,
and we want to get rid of child properties.
demos/gtk-demo/button_box.c | 127 -----
demos/gtk-demo/demo.gresource.xml | 1 -
demos/gtk-demo/meson.build | 1 -
examples/hello-world.c | 8 +-
gtk/gtk-autocleanups.h | 1 -
gtk/gtk.h | 1 -
gtk/gtkaboutdialog.c | 1 -
gtk/gtkappchooserdialog.c | 1 -
gtk/gtkbbox.c | 1090 -------------------------------------
gtk/gtkbbox.h | 130 -----
gtk/gtkbuilder.c | 2 +-
gtk/gtkdialog.c | 4 -
gtk/gtkenums.h | 3 +-
gtk/gtkinfobar.c | 8 -
gtk/gtkmessagedialog.c | 4 +-
gtk/meson.build | 2 -
gtk/ui/gtkappchooserdialog.ui | 3 +-
gtk/ui/gtkdialog.ui | 4 +-
gtk/ui/gtkfilechooserdialog.ui | 3 +-
gtk/ui/gtkinfobar.ui | 4 +-
tests/gdkgears.c | 2 +-
tests/meson.build | 1 -
tests/testbaseline.c | 2 +-
tests/testbbox.c | 173 ------
tests/testcalendar.c | 4 +-
tests/testfilechooser.c | 2 +-
tests/testgtk.c | 122 +----
tests/testiconview.c | 8 +-
tests/testorientable.c | 11 -
tests/testtreecolumns.c | 6 +-
testsuite/gtk/builder.c | 2 +-
31 files changed, 29 insertions(+), 1702 deletions(-)
---
diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml
index bbf603e1ad..d686f02b21 100644
--- a/demos/gtk-demo/demo.gresource.xml
+++ b/demos/gtk-demo/demo.gresource.xml
@@ -143,7 +143,6 @@
<file>application_demo.c</file>
<file>assistant.c</file>
<file>builder.c</file>
- <file>button_box.c</file>
<file>changedisplay.c</file>
<file>clipboard.c</file>
<file>colorsel.c</file>
diff --git a/demos/gtk-demo/meson.build b/demos/gtk-demo/meson.build
index 93c2902575..df8db17414 100644
--- a/demos/gtk-demo/meson.build
+++ b/demos/gtk-demo/meson.build
@@ -4,7 +4,6 @@ demos = files([
'application_demo.c',
'assistant.c',
'builder.c',
- 'button_box.c',
'changedisplay.c',
'clipboard.c',
'colorsel.c',
diff --git a/examples/hello-world.c b/examples/hello-world.c
index f6cb55bc3c..4005d66ca9 100644
--- a/examples/hello-world.c
+++ b/examples/hello-world.c
@@ -13,19 +13,19 @@ activate (GtkApplication *app,
{
GtkWidget *window;
GtkWidget *button;
- GtkWidget *button_box;
+ GtkWidget *box;
window = gtk_application_window_new (app);
gtk_window_set_title (GTK_WINDOW (window), "Window");
gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);
- button_box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_container_add (GTK_CONTAINER (window), button_box);
+ box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_container_add (GTK_CONTAINER (window), box);
button = gtk_button_new_with_label ("Hello World");
g_signal_connect (button, "clicked", G_CALLBACK (print_hello), NULL);
g_signal_connect_swapped (button, "clicked", G_CALLBACK (gtk_widget_destroy), window);
- gtk_container_add (GTK_CONTAINER (button_box), button);
+ gtk_container_add (GTK_CONTAINER (box), button);
gtk_widget_show (window);
}
diff --git a/gtk/gtk-autocleanups.h b/gtk/gtk-autocleanups.h
index 118779d1fa..8966a3dca1 100644
--- a/gtk/gtk-autocleanups.h
+++ b/gtk/gtk-autocleanups.h
@@ -36,7 +36,6 @@ G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkBox, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkBuildable, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkBuilder, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkButton, g_object_unref)
-G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkButtonBox, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCalendar, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellArea, g_object_unref)
G_DEFINE_AUTOPTR_CLEANUP_FUNC(GtkCellAreaBox, g_object_unref)
diff --git a/gtk/gtk.h b/gtk/gtk.h
index cf89eca9ab..4fb4fdec06 100644
--- a/gtk/gtk.h
+++ b/gtk/gtk.h
@@ -44,7 +44,6 @@
#include <gtk/gtkapplicationwindow.h>
#include <gtk/gtkaspectframe.h>
#include <gtk/gtkassistant.h>
-#include <gtk/gtkbbox.h>
#include <gtk/gtkbin.h>
#include <gtk/gtkbindings.h>
#include <gtk/gtkborder.h>
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index 6503f4ddaf..0fecd74e30 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -34,7 +34,6 @@
#include "gtkaboutdialog.h"
#include "gtkbutton.h"
-#include "gtkbbox.h"
#include "gtkdialog.h"
#include "gtkgrid.h"
#include "gtkbox.h"
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index ab382e9d02..80143686ec 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -48,7 +48,6 @@
#include "gtkmessagedialog.h"
#include "gtksettings.h"
#include "gtklabel.h"
-#include "gtkbbox.h"
#include "gtkbutton.h"
#include "gtkentry.h"
#include "gtktogglebutton.h"
diff --git a/gtk/gtkbuilder.c b/gtk/gtkbuilder.c
index 5e5ce9fd65..944e4d6704 100644
--- a/gtk/gtkbuilder.c
+++ b/gtk/gtkbuilder.c
@@ -171,7 +171,7 @@
* <child internal-child="vbox">
* <object class="GtkBox" id="vbox1">
* <child internal-child="action_area">
- * <object class="GtkButtonBox" id="hbuttonbox1">
+ * <object class="GtkBox" id="hbuttonbox1">
* <child>
* <object class="GtkButton" id="ok_button">
* <property name="label">gtk-ok</property>
diff --git a/gtk/gtkdialog.c b/gtk/gtkdialog.c
index 3604c592c9..b183f37718 100644
--- a/gtk/gtkdialog.c
+++ b/gtk/gtkdialog.c
@@ -31,7 +31,6 @@
#include "gtkdialog.h"
#include "gtkdialogprivate.h"
#include "gtkheaderbar.h"
-#include "gtkbbox.h"
#include "gtklabel.h"
#include "gtkmarshalers.h"
#include "gtkbox.h"
@@ -389,9 +388,6 @@ apply_response_for_action_area (GtkDialog *dialog,
GtkDialogPrivate *priv = gtk_dialog_get_instance_private (dialog);
g_assert (gtk_widget_get_parent (child) == priv->action_area);
-
- if (response_id == GTK_RESPONSE_HELP)
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area), child, TRUE);
}
static void
diff --git a/gtk/gtkenums.h b/gtk/gtkenums.h
index 0dd737e418..e6ea7b3bb4 100644
--- a/gtk/gtkenums.h
+++ b/gtk/gtkenums.h
@@ -346,8 +346,7 @@ typedef enum
* @GTK_PACK_START: The child is packed into the start of the box
* @GTK_PACK_END: The child is packed into the end of the box
*
- * Represents the packing location #GtkBox children. (See: #GtkVBox,
- * #GtkHBox, and #GtkButtonBox).
+ * Represents the packing location #GtkBox children
*/
typedef enum
{
diff --git a/gtk/gtkinfobar.c b/gtk/gtkinfobar.c
index faf1e6af4d..2b469fbfcb 100644
--- a/gtk/gtkinfobar.c
+++ b/gtk/gtkinfobar.c
@@ -35,7 +35,6 @@
#include "gtkaccessible.h"
#include "gtkbuildable.h"
#include "gtkbuilderprivate.h"
-#include "gtkbbox.h"
#include "gtkbox.h"
#include "gtklabel.h"
#include "gtkbutton.h"
@@ -510,9 +509,6 @@ gtk_info_bar_add_action_widget (GtkInfoBar *info_bar,
g_warning ("Only 'activatable' widgets can be packed into the action area of a GtkInfoBar");
gtk_container_add (GTK_CONTAINER (priv->action_area), child);
- if (response_id == GTK_RESPONSE_HELP)
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area),
- child, TRUE);
}
/**
@@ -975,10 +971,6 @@ gtk_info_bar_buildable_custom_finished (GtkBuildable *buildable,
G_OBJECT (info_bar));
g_signal_connect_closure_by_id (object, signal_id, 0, closure, FALSE);
}
-
- if (ad->response_id == GTK_RESPONSE_HELP)
- gtk_button_box_set_child_secondary (GTK_BUTTON_BOX (priv->action_area),
- GTK_WIDGET (object), TRUE);
}
g_slist_free_full (data->items, action_widget_info_free);
diff --git a/gtk/gtkmessagedialog.c b/gtk/gtkmessagedialog.c
index 19ebd784ba..e98a0ffb99 100644
--- a/gtk/gtkmessagedialog.c
+++ b/gtk/gtkmessagedialog.c
@@ -33,7 +33,6 @@
#include "gtkbuildable.h"
#include "gtklabel.h"
#include "gtkbox.h"
-#include "gtkbbox.h"
#include "gtkintl.h"
#include "gtkprivate.h"
#include "gtktypebuiltins.h"
@@ -281,7 +280,8 @@ gtk_message_dialog_init (GtkMessageDialog *dialog)
gtk_widget_init_template (GTK_WIDGET (dialog));
action_area = gtk_dialog_get_action_area (GTK_DIALOG (dialog));
- gtk_button_box_set_layout (GTK_BUTTON_BOX (action_area), GTK_BUTTONBOX_EXPAND);
+ gtk_widget_set_halign (action_area, GTK_ALIGN_FILL);
+ gtk_box_set_homogeneous (GTK_BOX (action_area), TRUE);
settings = gtk_widget_get_settings (GTK_WIDGET (dialog));
g_object_get (settings, "gtk-keynav-use-caret", &use_caret, NULL);
diff --git a/gtk/meson.build b/gtk/meson.build
index e45b18bf8e..f11ce957c3 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -167,7 +167,6 @@ gtk_public_sources = files([
'gtkapplicationwindow.c',
'gtkaspectframe.c',
'gtkassistant.c',
- 'gtkbbox.c',
'gtkbin.c',
'gtkbindings.c',
'gtkborder.c',
@@ -417,7 +416,6 @@ gtk_public_headers = files([
'gtkapplicationwindow.h',
'gtkaspectframe.h',
'gtkassistant.h',
- 'gtkbbox.h',
'gtkbin.h',
'gtkbindings.h',
'gtkborder.h',
diff --git a/gtk/ui/gtkappchooserdialog.ui b/gtk/ui/gtkappchooserdialog.ui
index 27a0a62114..6a3e0461a2 100644
--- a/gtk/ui/gtkappchooserdialog.ui
+++ b/gtk/ui/gtkappchooserdialog.ui
@@ -19,8 +19,7 @@
</object>
</child>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
- <property name="layout-style">end</property>
+ <object class="GtkBox" id="dialog-action_area1">
<property name="hexpand">1</property>
<property name="halign">end</property>
</object>
diff --git a/gtk/ui/gtkdialog.ui b/gtk/ui/gtkdialog.ui
index 1bd869b6c5..6780d241c7 100644
--- a/gtk/ui/gtkdialog.ui
+++ b/gtk/ui/gtkdialog.ui
@@ -29,9 +29,9 @@
<class name="dialog-action-box"/>
</style>
<child>
- <object class="GtkButtonBox" id="action_area">
- <property name="layout-style">end</property>
+ <object class="GtkBox" id="action_area">
<property name="hexpand">1</property>
+ <property name="halign">end</property>
<style>
<class name="dialog-action-area"/>
</style>
diff --git a/gtk/ui/gtkfilechooserdialog.ui b/gtk/ui/gtkfilechooserdialog.ui
index 22a0f3bfce..6ae9756c4f 100644
--- a/gtk/ui/gtkfilechooserdialog.ui
+++ b/gtk/ui/gtkfilechooserdialog.ui
@@ -10,9 +10,8 @@
<object class="GtkBox">
<property name="orientation">vertical</property>
<child internal-child="action_area">
- <object class="GtkButtonBox" id="dialog-action_area1">
+ <object class="GtkBox" id="dialog-action_area1">
<property name="margin">6</property>
- <property name="layout-style">end</property>
<property name="hexpand">1</property>
<property name="halign">end</property>
</object>
diff --git a/gtk/ui/gtkinfobar.ui b/gtk/ui/gtkinfobar.ui
index aa0b2a05c8..5e2f42f50c 100644
--- a/gtk/ui/gtkinfobar.ui
+++ b/gtk/ui/gtkinfobar.ui
@@ -15,10 +15,10 @@
</object>
</child>
<child>
- <object class="GtkButtonBox" id="action_area">
+ <object class="GtkBox" id="action_area">
<property name="spacing">6</property>
<property name="margin">6</property>
- <property name="layout-style">end</property>
+ <property name="halign">end</property>
</object>
</child>
<child>
diff --git a/tests/gdkgears.c b/tests/gdkgears.c
index 5c25350e28..2df86a98e2 100644
--- a/tests/gdkgears.c
+++ b/tests/gdkgears.c
@@ -221,7 +221,7 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (scrolled), extra_hbox);
gtk_widget_show (extra_hbox);
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+ bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_box_set_spacing (GTK_BOX (bbox), 6);
gtk_container_add (GTK_CONTAINER (box), bbox);
gtk_widget_show (bbox);
diff --git a/tests/meson.build b/tests/meson.build
index 1b32ce7c81..9e33e46912 100644
--- a/tests/meson.build
+++ b/tests/meson.build
@@ -18,7 +18,6 @@ gtk_tests = [
['testappchooserbutton'],
['testassistant'],
['testbaseline'],
- ['testbbox'],
['testbox'],
['testboxcss'],
['testbuttons'],
diff --git a/tests/testbaseline.c b/tests/testbaseline.c
index e61b649852..806914399d 100644
--- a/tests/testbaseline.c
+++ b/tests/testbaseline.c
@@ -329,7 +329,7 @@ main (int argc,
for (j = 0; j < 3; j++)
{
- hbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+ hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_container_add (GTK_CONTAINER (vbox), hbox);
gtk_box_set_baseline_position (GTK_BOX (hbox), j);
diff --git a/tests/testcalendar.c b/tests/testcalendar.c
index 499d101389..b89951e8cd 100644
--- a/tests/testcalendar.c
+++ b/tests/testcalendar.c
@@ -663,8 +663,8 @@ create_calendar(void)
* Glue everything together
*/
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_END);
+ bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_halign (bbox, GTK_ALIGN_END);
button = gtk_button_new_with_label ("Close");
g_signal_connect (button, "clicked", G_CALLBACK (gtk_main_quit), NULL);
diff --git a/tests/testfilechooser.c b/tests/testfilechooser.c
index e18419994b..ef0ffc6197 100644
--- a/tests/testfilechooser.c
+++ b/tests/testfilechooser.c
@@ -706,7 +706,7 @@ main (int argc, char **argv)
control_window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- vbbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
+ vbbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (control_window), vbbox);
button = gtk_button_new_with_mnemonic ("_Select all");
diff --git a/tests/testgtk.c b/tests/testgtk.c
index bef02a00be..37f403c3a9 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -597,122 +597,6 @@ create_radio_buttons (GtkWidget *widget)
gtk_widget_destroy (window);
}
-/*
- * GtkButtonBox
- */
-
-static GtkWidget *
-create_bbox (gint horizontal,
- char* title,
- gint spacing,
- gint child_w,
- gint child_h,
- gint layout)
-{
- GtkWidget *frame;
- GtkWidget *bbox;
- GtkWidget *button;
-
- frame = gtk_frame_new (title);
-
- if (horizontal)
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- else
- bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
-
- gtk_container_add (GTK_CONTAINER (frame), bbox);
-
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), layout);
- gtk_box_set_spacing (GTK_BOX (bbox), spacing);
-
- button = gtk_button_new_with_label ("OK");
- gtk_container_add (GTK_CONTAINER (bbox), button);
-
- button = gtk_button_new_with_label ("Cancel");
- gtk_container_add (GTK_CONTAINER (bbox), button);
-
- button = gtk_button_new_with_label ("Help");
- gtk_container_add (GTK_CONTAINER (bbox), button);
-
- return frame;
-}
-
-static void
-create_button_box (GtkWidget *widget)
-{
- static GtkWidget* window = NULL;
- GtkWidget *main_vbox;
- GtkWidget *vbox;
- GtkWidget *hbox;
- GtkWidget *frame_horz;
- GtkWidget *frame_vert;
-
- if (!window)
- {
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_display (GTK_WINDOW (window), gtk_widget_get_display (widget));
- gtk_window_set_title (GTK_WINDOW (window), "Button Boxes");
-
- g_signal_connect (window, "destroy",
- G_CALLBACK (gtk_widget_destroyed),
- &window);
-
- main_vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (window), main_vbox);
-
- frame_horz = gtk_frame_new ("Horizontal Button Boxes");
- gtk_widget_set_margin_top (frame_horz, 10);
- gtk_widget_set_margin_bottom (frame_horz, 10);
- gtk_container_add (GTK_CONTAINER (main_vbox), frame_horz);
-
- vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
- gtk_container_add (GTK_CONTAINER (frame_horz), vbox);
-
- gtk_container_add (GTK_CONTAINER (vbox),
- create_bbox (TRUE, "Spread", 40, 85, 20, GTK_BUTTONBOX_SPREAD));
-
- gtk_container_add (GTK_CONTAINER (vbox),
- create_bbox (TRUE, "Edge", 40, 85, 20, GTK_BUTTONBOX_EDGE));
-
- gtk_container_add (GTK_CONTAINER (vbox),
- create_bbox (TRUE, "Start", 40, 85, 20, GTK_BUTTONBOX_START));
-
- gtk_container_add (GTK_CONTAINER (vbox),
- create_bbox (TRUE, "End", 40, 85, 20, GTK_BUTTONBOX_END));
-
- gtk_container_add (GTK_CONTAINER (vbox),
- create_bbox (TRUE, "Center", 40, 85, 20, GTK_BUTTONBOX_CENTER));
-
- frame_vert = gtk_frame_new ("Vertical Button Boxes");
- gtk_widget_set_margin_top (frame_vert, 10);
- gtk_widget_set_margin_bottom (frame_vert, 10);
- gtk_container_add (GTK_CONTAINER (main_vbox), frame_vert);
-
- hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
- gtk_container_add (GTK_CONTAINER (frame_vert), hbox);
-
- gtk_container_add (GTK_CONTAINER (hbox),
- create_bbox (FALSE, "Spread", 30, 85, 20, GTK_BUTTONBOX_SPREAD));
-
- gtk_container_add (GTK_CONTAINER (hbox),
- create_bbox (FALSE, "Edge", 30, 85, 20, GTK_BUTTONBOX_EDGE));
-
- gtk_container_add (GTK_CONTAINER (hbox),
- create_bbox (FALSE, "Start", 30, 85, 20, GTK_BUTTONBOX_START));
-
- gtk_container_add (GTK_CONTAINER (hbox),
- create_bbox (FALSE, "End", 30, 85, 20, GTK_BUTTONBOX_END));
-
- gtk_container_add (GTK_CONTAINER (hbox),
- create_bbox (FALSE, "Center", 30, 85, 20, GTK_BUTTONBOX_CENTER));
- }
-
- if (!gtk_widget_get_visible (window))
- gtk_widget_show (window);
- else
- gtk_widget_destroy (window);
-}
-
/*
* GtkToolBar
*/
@@ -3602,7 +3486,7 @@ create_forward_back (const char *title,
GtkTextDirection text_dir)
{
GtkWidget *frame = gtk_frame_new (title);
- GtkWidget *bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+ GtkWidget *bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget *back_button = gtk_button_new_with_label ("Back");
GtkWidget *forward_button = gtk_button_new_with_label ("Forward");
@@ -3902,7 +3786,8 @@ create_display_screen (GtkWidget *widget)
gtk_grid_attach (GTK_GRID (grid), label_dpy, 0, 0, 1, 1);
gtk_grid_attach (GTK_GRID (grid), combo_dpy, 0, 1, 1, 1);
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
+ bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_halign (bbox, GTK_ALIGN_END);
applyb = gtk_button_new_with_label ("_Apply");
cancelb = gtk_button_new_with_label ("_Cancel");
@@ -6674,7 +6559,6 @@ struct {
} buttons[] =
{
{ "alpha window", create_alpha_window },
- { "button box", create_button_box },
{ "buttons", create_buttons },
{ "check buttons", create_check_buttons },
{ "color selection", create_color_selection },
diff --git a/tests/testiconview.c b/tests/testiconview.c
index 576133ad33..87250d57a0 100644
--- a/tests/testiconview.c
+++ b/tests/testiconview.c
@@ -539,8 +539,8 @@ main (gint argc, gchar **argv)
gtk_paned_add2 (GTK_PANED (paned), scrolled_window);
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START);
+ bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_halign (bbox, GTK_ALIGN_START);
gtk_container_add (GTK_CONTAINER (vbox), bbox);
button = gtk_button_new_with_label ("Add some");
@@ -563,8 +563,8 @@ main (gint argc, gchar **argv)
g_signal_connect (button, "clicked", G_CALLBACK (swap_rows), icon_list);
gtk_container_add (GTK_CONTAINER (bbox), button);
- bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_START);
+ bbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
+ gtk_widget_set_halign (bbox, GTK_ALIGN_START);
gtk_container_add (GTK_CONTAINER (vbox), bbox);
button = gtk_button_new_with_label ("Select all");
diff --git a/tests/testorientable.c b/tests/testorientable.c
index f997c9209a..c002eebd96 100644
--- a/tests/testorientable.c
+++ b/tests/testorientable.c
@@ -69,17 +69,6 @@ main (int argc, char **argv)
gtk_container_add (GTK_CONTAINER (box),
gtk_button_new_with_label ("GtkBox 3"));
- /* GtkButtonBox */
- box = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
- orientables = g_list_prepend (orientables, box);
- gtk_grid_attach (GTK_GRID (grid), box, 1, 1, 1, 1);
- gtk_container_add (GTK_CONTAINER (box),
- gtk_button_new_with_label ("GtkButtonBox 1"));
- gtk_container_add (GTK_CONTAINER (box),
- gtk_button_new_with_label ("GtkButtonBox 2"));
- gtk_container_add (GTK_CONTAINER (box),
- gtk_button_new_with_label ("GtkButtonBox 3"));
-
/* GtkSeparator */
box = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
orientables = g_list_prepend (orientables, box);
diff --git a/tests/testtreecolumns.c b/tests/testtreecolumns.c
index ad58c97833..b22f5fbf95 100644
--- a/tests/testtreecolumns.c
+++ b/tests/testtreecolumns.c
@@ -792,8 +792,7 @@ main (int argc, char *argv[])
vbox2 = gtk_box_new (GTK_ORIENTATION_VERTICAL, 8);
gtk_container_add (GTK_CONTAINER (hbox), vbox2);
- bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
+ bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (vbox2), bbox);
button = gtk_button_new_with_mnemonic ("<< (_Q)");
@@ -810,8 +809,7 @@ main (int argc, char *argv[])
"changed", G_CALLBACK (selection_changed), button);
gtk_container_add (GTK_CONTAINER (bbox), button);
- bbox = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
- gtk_button_box_set_layout (GTK_BUTTON_BOX (bbox), GTK_BUTTONBOX_SPREAD);
+ bbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_container_add (GTK_CONTAINER (vbox2), bbox);
button = gtk_button_new_with_mnemonic ("<< (_E)");
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index 73c2518a6d..2837c4a4ce 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -965,7 +965,7 @@ test_children (void)
action_area = gtk_builder_get_object (builder, "dialog1-action_area");
g_assert (action_area != NULL);
- g_assert (GTK_IS_BUTTON_BOX (action_area));
+ g_assert (GTK_IS_BOX (action_area));
g_assert (gtk_orientable_get_orientation (GTK_ORIENTABLE (action_area)) == GTK_ORIENTATION_HORIZONTAL);
g_assert (gtk_widget_get_parent (GTK_WIDGET (action_area)) != NULL);
g_assert (gtk_buildable_get_name (GTK_BUILDABLE (action_area)) != NULL);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]