diff options
author | Matthias Clasen <mclasen@redhat.com> | 2019-02-05 13:06:09 +0000 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2019-02-05 13:06:09 +0000 |
commit | 3489ed087dc25d0a452c21a26659f6cdbe67c2cf (patch) | |
tree | 22b7bd8909979b4415496c372d7ca2ff1c14ebfa /demos | |
parent | ca1ffa0c23d01a65fa4c922ab3b273300ba7c055 (diff) | |
parent | 32e61b955acfa544ef7b4b6c47eb73653306bd05 (diff) | |
download | gtk+-3489ed087dc25d0a452c21a26659f6cdbe67c2cf.tar.gz |
Merge branch 'kill-buttonbox' into 'master'
Drop GtkButtonBox
See merge request GNOME/gtk!554
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/button_box.c | 127 | ||||
-rw-r--r-- | demos/gtk-demo/demo.gresource.xml | 1 | ||||
-rw-r--r-- | demos/gtk-demo/meson.build | 1 |
3 files changed, 0 insertions, 129 deletions
diff --git a/demos/gtk-demo/button_box.c b/demos/gtk-demo/button_box.c deleted file mode 100644 index 1dd1b9a65b..0000000000 --- a/demos/gtk-demo/button_box.c +++ /dev/null @@ -1,127 +0,0 @@ -/* Button Boxes - * - * The Button Box widgets are used to arrange buttons with padding. - */ - -#include <glib/gi18n.h> -#include <gtk/gtk.h> - -static GtkWidget * -create_bbox (gint horizontal, - char *title, - gint spacing, - 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); - - g_object_set (bbox, "margin", 5, NULL); - - 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; -} - -GtkWidget * -do_button_box (GtkWidget *do_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 (do_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); - g_object_set (main_vbox, "margin", 10, NULL); - 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, 10); - g_object_set (vbox, "margin", 10, NULL); - gtk_container_add (GTK_CONTAINER (frame_horz), vbox); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "Spread", 40, GTK_BUTTONBOX_SPREAD)); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "Edge", 40, GTK_BUTTONBOX_EDGE)); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "Start", 40, GTK_BUTTONBOX_START)); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "End", 40, GTK_BUTTONBOX_END)); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "Center", 40, GTK_BUTTONBOX_CENTER)); - - gtk_container_add (GTK_CONTAINER (vbox), - create_bbox (TRUE, "Expand", 0, GTK_BUTTONBOX_EXPAND)); - - frame_vert = gtk_frame_new ("Vertical Button Boxes"); - gtk_container_add (GTK_CONTAINER (main_vbox), frame_vert); - - hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 10); - g_object_set (hbox, "margin", 10, NULL); - gtk_container_add (GTK_CONTAINER (frame_vert), hbox); - - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "Spread", 10, GTK_BUTTONBOX_SPREAD)); - - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "Edge", 10, GTK_BUTTONBOX_EDGE)); - - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "Start", 10, GTK_BUTTONBOX_START)); - - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "End", 10, GTK_BUTTONBOX_END)); - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "Center", 10, GTK_BUTTONBOX_CENTER)); - gtk_container_add (GTK_CONTAINER (hbox), - create_bbox (FALSE, "Expand", 0, GTK_BUTTONBOX_EXPAND)); - } - - if (!gtk_widget_get_visible (window)) - gtk_widget_show (window); - else - gtk_widget_destroy (window); - - return window; -} 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', |