[gtk+] testgtk: Move display example from GtkTable to GtkGrid
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] testgtk: Move display example from GtkTable to GtkGrid
- Date: Wed, 28 Sep 2011 03:36:41 +0000 (UTC)
commit 6e8b4c851a7ee8915608cf7c28b0aeb81953d2fa
Author: Benjamin Otte <otte redhat com>
Date: Wed Sep 28 05:13:00 2011 +0200
testgtk: Move display example from GtkTable to GtkGrid
tests/testgtk.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
---
diff --git a/tests/testgtk.c b/tests/testgtk.c
index 73ad662..c57957b 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -5554,7 +5554,7 @@ screen_display_destroy_diag (GtkWidget *widget, GtkWidget *data)
void
create_display_screen (GtkWidget *widget)
{
- GtkWidget *table, *frame, *window, *combo_dpy, *vbox;
+ GtkWidget *grid, *frame, *window, *combo_dpy, *vbox;
GtkWidget *radio_dpy, *radio_scr, *applyb, *cancelb;
GtkWidget *bbox;
ScreenDisplaySelection *scr_dpy_data;
@@ -5576,11 +5576,11 @@ create_display_screen (GtkWidget *widget)
frame = gtk_frame_new ("Select screen or display");
gtk_container_add (GTK_CONTAINER (vbox), frame);
- table = gtk_table_new (2, 2, TRUE);
- gtk_table_set_row_spacings (GTK_TABLE (table), 3);
- gtk_table_set_col_spacings (GTK_TABLE (table), 3);
+ grid = gtk_grid_new ();
+ gtk_grid_set_row_spacing (GTK_GRID (grid), 3);
+ gtk_grid_set_column_spacing (GTK_GRID (grid), 3);
- gtk_container_add (GTK_CONTAINER (frame), table);
+ gtk_container_add (GTK_CONTAINER (frame), grid);
radio_dpy = gtk_radio_button_new_with_label (NULL, "move to another X display");
if (gdk_display_get_n_screens(display) > 1)
@@ -5594,13 +5594,14 @@ create_display_screen (GtkWidget *widget)
gtk_widget_set_sensitive (radio_scr, FALSE);
}
combo_dpy = gtk_combo_box_text_new_with_entry ();
+ gtk_widget_set_hexpand (combo_dpy, TRUE);
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo_dpy), "diabolo:0.0");
gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_dpy))),
"<hostname>:<X Server Num>.<Screen Num>");
- gtk_table_attach_defaults (GTK_TABLE (table), radio_dpy, 0, 1, 0, 1);
- gtk_table_attach_defaults (GTK_TABLE (table), radio_scr, 0, 1, 1, 2);
- gtk_table_attach_defaults (GTK_TABLE (table), combo_dpy, 1, 2, 0, 1);
+ gtk_grid_attach (GTK_GRID (grid), radio_dpy, 0, 0, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), radio_scr, 0, 1, 1, 1);
+ gtk_grid_attach (GTK_GRID (grid), combo_dpy, 1, 0, 1, 1);
bbox = gtk_button_box_new (GTK_ORIENTATION_HORIZONTAL);
applyb = gtk_button_new_from_stock (GTK_STOCK_APPLY);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]