[goocanvas] gtk4: demos: Adapt to change gtk_box_pack_start().
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [goocanvas] gtk4: demos: Adapt to change gtk_box_pack_start().
- Date: Mon, 29 May 2017 19:24:50 +0000 (UTC)
commit e0dd2bb2ab74c986cb7366a84206762c9fb38237
Author: Murray Cumming <murrayc murrayc com>
Date: Mon May 29 21:22:24 2017 +0200
gtk4: demos: Adapt to change gtk_box_pack_start().
demo/demo-animation.c | 12 +++++--
demo/demo-arrowhead.c | 6 ++-
demo/demo-clipping.c | 6 +++-
demo/demo-events.c | 4 +-
demo/demo-features.c | 4 +-
demo/demo-fifteen.c | 8 +++-
demo/demo-focus.c | 8 +++-
demo/demo-grabs.c | 4 +-
demo/demo-large-items.c | 14 +++++---
demo/demo-paths.c | 10 ++++--
demo/demo-scalability.c | 6 +++-
demo/demo-table.c | 6 +++-
demo/demo.c | 66 ++++++++++++++++++++------------------
demo/generic-position-demo.c | 8 +++-
demo/mv-demo-animation.c | 12 +++++--
demo/mv-demo-arrowhead.c | 8 +++-
demo/mv-demo-clipping.c | 6 +++-
demo/mv-demo-events.c | 4 +-
demo/mv-demo-features.c | 4 +-
demo/mv-demo-fifteen.c | 8 +++-
demo/mv-demo-focus.c | 8 +++-
demo/mv-demo-grabs.c | 4 +-
demo/mv-demo-paths.c | 10 ++++--
demo/mv-demo-scalability.c | 6 +++-
demo/mv-demo-table.c | 6 +++-
demo/mv-demo.c | 56 +++++++++++++++++---------------
demo/mv-generic-position-demo.c | 8 +++-
demo/mv-table-demo.c | 16 +++++++--
demo/table-demo.c | 16 +++++++--
demo/units-demo.c | 12 +++++--
demo/widgets-demo.c | 36 ++++++++++++---------
31 files changed, 244 insertions(+), 138 deletions(-)
---
diff --git a/demo/demo-animation.c b/demo/demo-animation.c
index 6fe0bd7..ee27637 100644
--- a/demo/demo-animation.c
+++ b/demo/demo-animation.c
@@ -118,17 +118,17 @@ create_animation_page (void)
gtk_widget_show (vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
w = gtk_button_new_with_label("Start Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked),
NULL);
w = gtk_button_new_with_label("Stop Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked),
NULL);
@@ -138,7 +138,11 @@ create_animation_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
diff --git a/demo/demo-arrowhead.c b/demo/demo-arrowhead.c
index de51b13..553c239 100644
--- a/demo/demo-arrowhead.c
+++ b/demo/demo-arrowhead.c
@@ -420,17 +420,19 @@ create_canvas_arrowhead (void)
w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n"
"to change the shape of the line and its arrowhead. You can see the\n"
"arrows at their normal scale on the right hand side of the window.");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_widget_show (frame);
g_object_set (frame,
"halign", GTK_ALIGN_CENTER,
"valign", GTK_ALIGN_CENTER,
+ "hexpand", TRUE,
+ "vexpand", TRUE,
NULL);
canvas = goo_canvas_new ();
diff --git a/demo/demo-clipping.c b/demo/demo-clipping.c
index 1f7b252..490506a 100644
--- a/demo/demo-clipping.c
+++ b/demo/demo-clipping.c
@@ -145,7 +145,11 @@ create_clipping_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
diff --git a/demo/demo-events.c b/demo/demo-events.c
index c50c908..c41342b 100644
--- a/demo/demo-events.c
+++ b/demo/demo-events.c
@@ -136,14 +136,14 @@ create_events_page (void)
/* Instructions */
label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe
first 2 items in each group are 1) invisible and 2) visible but unpainted.");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
/* Frame and canvas */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_widget_show (frame);
g_object_set (frame,
diff --git a/demo/demo-features.c b/demo/demo-features.c
index 77079db..7221441 100644
--- a/demo/demo-features.c
+++ b/demo/demo-features.c
@@ -58,14 +58,14 @@ create_canvas_features (void)
/* Instructions */
w = gtk_label_new ("Reparent test: click on the items to switch them between parents");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
/* Frame and canvas */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_widget_show (frame);
g_object_set (frame,
diff --git a/demo/demo-fifteen.c b/demo/demo-fifteen.c
index d4e783c..e3ad454 100644
--- a/demo/demo-fifteen.c
+++ b/demo/demo-fifteen.c
@@ -248,7 +248,11 @@ create_canvas_fifteen (void)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
+ gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (frame, TRUE);
+ gtk_widget_set_vexpand (frame, TRUE);
gtk_widget_show (frame);
g_object_set (frame,
@@ -317,7 +321,7 @@ create_canvas_fifteen (void)
/* Scramble button */
button = gtk_button_new_with_label ("Scramble");
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), button);
g_object_set_data (G_OBJECT (button), "board", board);
g_signal_connect (button, "clicked",
G_CALLBACK (scramble),
diff --git a/demo/demo-focus.c b/demo/demo-focus.c
index f441f06..eab73d2 100644
--- a/demo/demo-focus.c
+++ b/demo/demo-focus.c
@@ -143,14 +143,18 @@ create_focus_page (void)
gtk_widget_show (vbox);
label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas
items.");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_can_focus (canvas, TRUE);
diff --git a/demo/demo-grabs.c b/demo/demo-grabs.c
index 939b059..63a6fe6 100644
--- a/demo/demo-grabs.c
+++ b/demo/demo-grabs.c
@@ -370,14 +370,14 @@ create_grabs_page (void)
gtk_widget_show (vbox);
label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events
they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive
now.\n(They should all receive the same events.)");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
grid = gtk_grid_new ();
g_object_set (grid, "margin", 12, NULL);
gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), grid);
g_object_set (grid, "halign", GTK_ALIGN_CENTER, NULL);
gtk_widget_show (grid);
diff --git a/demo/demo-large-items.c b/demo/demo-large-items.c
index 245a85e..8d66486 100644
--- a/demo/demo-large-items.c
+++ b/demo/demo-large-items.c
@@ -75,18 +75,22 @@ create_large_items_page (void)
CANVAS_RIGHT, CANVAS_BOTTOM, MAX_ZOOM);
w = gtk_label_new (text);
g_free (text);
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
/* Create the canvas. */
canvas = goo_canvas_new ();
@@ -140,7 +144,7 @@ create_large_items_page (void)
/* Zoom */
w = gtk_label_new ("Zoom:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 10.00, 0.05, 0.50, 0.50));
@@ -149,7 +153,7 @@ create_large_items_page (void)
G_CALLBACK (zoom_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
return vbox;
diff --git a/demo/demo-paths.c b/demo/demo-paths.c
index 434ca71..97523ee 100644
--- a/demo/demo-paths.c
+++ b/demo/demo-paths.c
@@ -153,14 +153,18 @@ create_paths_page (void)
gtk_widget_show (vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
@@ -171,7 +175,7 @@ create_paths_page (void)
setup_canvas (canvas);
w = gtk_button_new_with_label ("Move Path");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (move_path_clicked), canvas);
diff --git a/demo/demo-scalability.c b/demo/demo-scalability.c
index 0dcbe8c..281afb6 100644
--- a/demo/demo-scalability.c
+++ b/demo/demo-scalability.c
@@ -51,7 +51,11 @@ create_canvas_scalability (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
diff --git a/demo/demo-table.c b/demo/demo-table.c
index b08305a..538fbe0 100644
--- a/demo/demo-table.c
+++ b/demo/demo-table.c
@@ -388,7 +388,11 @@ create_table_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
diff --git a/demo/demo.c b/demo/demo.c
index f696dc8..4643314 100644
--- a/demo/demo.c
+++ b/demo/demo.c
@@ -478,11 +478,11 @@ create_canvas_primitives ()
gtk_widget_show (vbox);
w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3
to raise it.");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
/* Create the canvas */
@@ -503,7 +503,7 @@ create_canvas_primitives ()
/* Scale */
w = gtk_label_new ("Scale:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50));
@@ -512,12 +512,12 @@ create_canvas_primitives ()
G_CALLBACK (zoom_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_label_new ("Scale X:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50));
@@ -526,12 +526,12 @@ create_canvas_primitives ()
G_CALLBACK (zoom_x_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_label_new ("Scale Y:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50));
@@ -540,18 +540,18 @@ create_canvas_primitives ()
G_CALLBACK (zoom_y_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
/* Center: */
w = gtk_check_button_new_with_label("Center scroll region");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
/*gtk_widget_show (w);*/
g_signal_connect (w, "toggled",
G_CALLBACK (center_toggled),
@@ -560,7 +560,7 @@ create_canvas_primitives ()
/* Move Ellipse */
w = gtk_button_new_with_label("Move Ellipse");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (move_ellipse_clicked),
@@ -569,7 +569,7 @@ create_canvas_primitives ()
/* Animate Ellipse */
w = gtk_button_new_with_label("Animate Ellipse");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (animate_ellipse_clicked),
@@ -578,7 +578,7 @@ create_canvas_primitives ()
/* Stop Animation */
w = gtk_button_new_with_label("Stop Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (stop_animation_clicked),
@@ -589,7 +589,7 @@ create_canvas_primitives ()
/* Create PDF */
w = gtk_button_new_with_label("Write PDF");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (write_pdf_clicked),
@@ -597,38 +597,38 @@ create_canvas_primitives ()
#endif
w = gtk_button_new_with_label("Change Bounds");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (change_bounds_clicked),
canvas);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
/* Scroll to */
w = gtk_label_new ("Scroll To:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_button_new_with_label("50,50");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_50_50_clicked),
canvas);
w = gtk_button_new_with_label("250,250");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_250_250_clicked),
canvas);
w = gtk_button_new_with_label("500,500");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_500_500_clicked),
@@ -637,12 +637,12 @@ create_canvas_primitives ()
/* Scroll anchor */
w = gtk_label_new ("Anchor:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_radio_button_new_with_label (group, "NW");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -652,7 +652,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "N");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -662,7 +662,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "NE");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -672,7 +672,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "W");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -682,7 +682,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "C");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -692,7 +692,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "E");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -702,7 +702,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "SW");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -712,7 +712,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "S");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -722,7 +722,7 @@ create_canvas_primitives ()
w = gtk_radio_button_new_with_label (group, "SE");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -735,7 +735,11 @@ create_canvas_primitives ()
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
gtk_widget_show (canvas);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
diff --git a/demo/generic-position-demo.c b/demo/generic-position-demo.c
index 4156e49..89686e4 100644
--- a/demo/generic-position-demo.c
+++ b/demo/generic-position-demo.c
@@ -192,7 +192,7 @@ main ()
label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items");
g_object_set (label, "halign", GTK_ALIGN_START, NULL);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
/* Create top canvas. */
@@ -200,7 +200,11 @@ main ()
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL);
diff --git a/demo/mv-demo-animation.c b/demo/mv-demo-animation.c
index 9be1dff..4ed74ff 100644
--- a/demo/mv-demo-animation.c
+++ b/demo/mv-demo-animation.c
@@ -117,17 +117,17 @@ create_animation_page (void)
gtk_widget_show (vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
w = gtk_button_new_with_label("Start Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (start_animation_clicked),
NULL);
w = gtk_button_new_with_label("Stop Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (stop_animation_clicked),
NULL);
@@ -137,7 +137,11 @@ create_animation_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
diff --git a/demo/mv-demo-arrowhead.c b/demo/mv-demo-arrowhead.c
index 1c22a1e..a13b1e0 100644
--- a/demo/mv-demo-arrowhead.c
+++ b/demo/mv-demo-arrowhead.c
@@ -435,12 +435,16 @@ create_canvas_arrowhead (void)
w = gtk_label_new ("This demo allows you to edit arrowhead shapes. Drag the little boxes\n"
"to change the shape of the line and its arrowhead. You can see the\n"
"arrows at their normal scale on the right hand side of the window.");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
+ gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (frame, TRUE);
+ gtk_widget_set_vexpand (frame, TRUE);
gtk_widget_show (frame);
g_object_set (frame,
diff --git a/demo/mv-demo-clipping.c b/demo/mv-demo-clipping.c
index 9fe1242..c631208 100644
--- a/demo/mv-demo-clipping.c
+++ b/demo/mv-demo-clipping.c
@@ -159,7 +159,11 @@ create_clipping_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
diff --git a/demo/mv-demo-events.c b/demo/mv-demo-events.c
index 9fc71c1..05b84e7 100644
--- a/demo/mv-demo-events.c
+++ b/demo/mv-demo-events.c
@@ -137,14 +137,14 @@ create_events_page (void)
/* Instructions */
label = gtk_label_new ("Move the mouse over the items to check they receive the right motion events.\nThe
first 2 items in each group are 1) invisible and 2) visible but unpainted.");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
/* Frame and canvas */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_widget_show (frame);
g_object_set (frame,
diff --git a/demo/mv-demo-features.c b/demo/mv-demo-features.c
index e9bb951..51952b7 100644
--- a/demo/mv-demo-features.c
+++ b/demo/mv-demo-features.c
@@ -65,14 +65,14 @@ create_canvas_features (void)
/* Instructions */
w = gtk_label_new ("Reparent test: click on the items to switch them between parents");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
/* Frame and canvas */
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
gtk_widget_show (frame);
g_object_set (frame,
diff --git a/demo/mv-demo-fifteen.c b/demo/mv-demo-fifteen.c
index 172ef86..1eb27aa 100644
--- a/demo/mv-demo-fifteen.c
+++ b/demo/mv-demo-fifteen.c
@@ -259,7 +259,11 @@ create_canvas_fifteen (void)
frame = gtk_frame_new (NULL);
gtk_frame_set_shadow_type (GTK_FRAME (frame), GTK_SHADOW_IN);
- gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), frame);
+ gtk_widget_set_halign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (frame, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (frame, TRUE);
+ gtk_widget_set_vexpand (frame, TRUE);
gtk_widget_show (frame);
g_object_set (frame,
@@ -326,7 +330,7 @@ create_canvas_fifteen (void)
/* Scramble button */
button = gtk_button_new_with_label ("Scramble");
- gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), button);
g_object_set_data (G_OBJECT (button), "board", board);
g_signal_connect (button, "clicked",
G_CALLBACK (scramble),
diff --git a/demo/mv-demo-focus.c b/demo/mv-demo-focus.c
index 04beb14..348000d 100644
--- a/demo/mv-demo-focus.c
+++ b/demo/mv-demo-focus.c
@@ -158,14 +158,18 @@ create_focus_page (void)
gtk_widget_show (vbox);
label = gtk_label_new ("Use Tab, Shift+Tab or the arrow keys to move the keyboard focus between the canvas
items.");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_can_focus (canvas, TRUE);
diff --git a/demo/mv-demo-grabs.c b/demo/mv-demo-grabs.c
index 10a787b..147b856 100644
--- a/demo/mv-demo-grabs.c
+++ b/demo/mv-demo-grabs.c
@@ -381,14 +381,14 @@ create_grabs_page (void)
gtk_widget_show (vbox);
label = gtk_label_new ("Move the mouse over the widgets and canvas items on the right to see what events
they receive.\nClick buttons to start explicit or implicit pointer grabs and see what events they receive
now.\n(They should all receive the same events.)");
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
grid = gtk_grid_new ();
g_object_set (grid, "margin", 12, NULL);
gtk_grid_set_row_spacing (GTK_GRID (grid), 12);
gtk_grid_set_column_spacing (GTK_GRID (grid), 12);
- gtk_box_pack_start (GTK_BOX (vbox), grid, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), grid);
g_object_set (grid, "halign", GTK_ALIGN_CENTER, NULL);
gtk_widget_show (grid);
diff --git a/demo/mv-demo-paths.c b/demo/mv-demo-paths.c
index 5246da5..71bff90 100644
--- a/demo/mv-demo-paths.c
+++ b/demo/mv-demo-paths.c
@@ -133,14 +133,18 @@ create_paths_page (void)
gtk_widget_show (vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 450);
@@ -153,7 +157,7 @@ create_paths_page (void)
g_object_unref (root);
w = gtk_button_new_with_label ("Move Path");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (move_path_clicked), canvas);
diff --git a/demo/mv-demo-scalability.c b/demo/mv-demo-scalability.c
index 3225b36..32d3f31 100644
--- a/demo/mv-demo-scalability.c
+++ b/demo/mv-demo-scalability.c
@@ -52,7 +52,11 @@ create_canvas_scalability (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
diff --git a/demo/mv-demo-table.c b/demo/mv-demo-table.c
index 3892559..2c18dbc 100644
--- a/demo/mv-demo-table.c
+++ b/demo/mv-demo-table.c
@@ -391,7 +391,11 @@ create_table_page (void)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = (GooCanvas*) goo_canvas_new ();
gtk_widget_set_size_request ((GtkWidget*) canvas, 600, 450);
diff --git a/demo/mv-demo.c b/demo/mv-demo.c
index 3ca6863..c38eedb 100644
--- a/demo/mv-demo.c
+++ b/demo/mv-demo.c
@@ -402,11 +402,11 @@ create_canvas_primitives (GooCanvasItemModel *model,
gtk_widget_show (vbox);
w = gtk_label_new ("Drag an item with button 1. Click button 2 on an item to lower it, or button 3
to raise it.");
- gtk_box_pack_start (GTK_BOX (vbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), w);
gtk_widget_show (w);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
/* Create the canvas */
@@ -430,7 +430,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Zoom */
w = gtk_label_new ("Zoom:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 50.00, 0.05, 0.50, 0.50));
@@ -439,13 +439,13 @@ create_canvas_primitives (GooCanvasItemModel *model,
G_CALLBACK (zoom_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
/* Center: */
w = gtk_check_button_new_with_label("Center scroll region");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
/*gtk_widget_show (w);*/
g_signal_connect (w, "toggled",
G_CALLBACK (center_toggled),
@@ -454,7 +454,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Move Ellipse */
w = gtk_button_new_with_label("Move Ellipse");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (move_ellipse_clicked),
@@ -463,7 +463,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Animate Ellipse */
w = gtk_button_new_with_label("Animate Ellipse");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (animate_ellipse_clicked),
@@ -472,7 +472,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Stop Animation */
w = gtk_button_new_with_label("Stop Animation");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (stop_animation_clicked),
@@ -483,7 +483,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Create PDF */
w = gtk_button_new_with_label("Write PDF");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (write_pdf_clicked),
@@ -491,38 +491,38 @@ create_canvas_primitives (GooCanvasItemModel *model,
#endif
w = gtk_button_new_with_label("Change Bounds");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (change_bounds_clicked),
canvas);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
/* Scroll to */
w = gtk_label_new ("Scroll To:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_button_new_with_label("50,50");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_50_50_clicked),
canvas);
w = gtk_button_new_with_label("250,250");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_250_250_clicked),
canvas);
w = gtk_button_new_with_label("500,500");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked",
G_CALLBACK (scroll_to_500_500_clicked),
@@ -531,12 +531,12 @@ create_canvas_primitives (GooCanvasItemModel *model,
/* Scroll anchor */
w = gtk_label_new ("Anchor:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
w = gtk_radio_button_new_with_label (group, "NW");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -546,7 +546,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "N");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -556,7 +556,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "NE");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -566,7 +566,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "W");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -576,7 +576,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "C");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -586,7 +586,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "E");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -596,7 +596,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "SW");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -606,7 +606,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "S");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -616,7 +616,7 @@ create_canvas_primitives (GooCanvasItemModel *model,
w = gtk_radio_button_new_with_label (group, "SE");
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (w));
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "toggled",
G_CALLBACK (anchor_toggled),
@@ -629,7 +629,11 @@ create_canvas_primitives (GooCanvasItemModel *model,
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
gtk_widget_show (canvas);
gtk_container_add (GTK_CONTAINER (scrolled_win), canvas);
diff --git a/demo/mv-generic-position-demo.c b/demo/mv-generic-position-demo.c
index 9f140ca..be8d617 100644
--- a/demo/mv-generic-position-demo.c
+++ b/demo/mv-generic-position-demo.c
@@ -193,7 +193,7 @@ create_window (GooCanvasItemModel *model)
label = gtk_label_new ("Use Ctrl+Left Click to move items or Ctrl+Right Click to resize items");
g_object_set (label, "halign", GTK_ALIGN_START, NULL);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
gtk_widget_show (label);
/* Create top canvas. */
@@ -201,7 +201,11 @@ create_window (GooCanvasItemModel *model)
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
g_object_set (G_OBJECT (canvas), "integer-layout", TRUE, NULL);
diff --git a/demo/mv-table-demo.c b/demo/mv-table-demo.c
index f31c6cf..edb4375 100644
--- a/demo/mv-table-demo.c
+++ b/demo/mv-table-demo.c
@@ -236,14 +236,18 @@ main ()
label = gtk_label_new ("Normal Layout");
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create top canvas. */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 250);
@@ -256,14 +260,18 @@ main ()
label = gtk_label_new ("Integer Layout");
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create bottom canvas. */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
g_object_set (canvas,
diff --git a/demo/table-demo.c b/demo/table-demo.c
index f7ec6ba..7c10568 100644
--- a/demo/table-demo.c
+++ b/demo/table-demo.c
@@ -230,14 +230,18 @@ main ()
label = gtk_label_new ("Normal Layout");
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create top canvas. */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_size_request (canvas, 600, 250);
@@ -250,14 +254,18 @@ main ()
label = gtk_label_new ("Integer Layout");
gtk_widget_show (label);
- gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), label);
/* Create bottom canvas. */
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
g_object_set (canvas,
diff --git a/demo/units-demo.c b/demo/units-demo.c
index 0b67de3..9ac7fa7 100644
--- a/demo/units-demo.c
+++ b/demo/units-demo.c
@@ -105,13 +105,13 @@ create_canvas (GtkUnit units,
gtk_widget_show (vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
canvas = goo_canvas_new ();
w = gtk_label_new ("Zoom:");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
adj = GTK_ADJUSTMENT (gtk_adjustment_new (1.00, 0.05, 100.00, 0.05, 0.50, 0.50));
@@ -120,11 +120,15 @@ create_canvas (GtkUnit units,
G_CALLBACK (zoom_changed),
canvas);
gtk_widget_set_size_request (w, 50, -1);
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
scrolled_win = gtk_scrolled_window_new (NULL, NULL);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
gtk_widget_show (scrolled_win);
/* Create the canvas. */
diff --git a/demo/widgets-demo.c b/demo/widgets-demo.c
index e570af5..3bdd86c 100644
--- a/demo/widgets-demo.c
+++ b/demo/widgets-demo.c
@@ -287,60 +287,60 @@ main ()
gtk_container_add (GTK_CONTAINER (window), vbox);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
w = gtk_button_new_with_label ("Add Widget");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (add_widget_clicked), NULL);
w = gtk_button_new_with_label ("Remove Widget");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (remove_widget_clicked), NULL);
w = gtk_button_new_with_label ("Move Widget");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (move_widget_clicked), NULL);
w = gtk_button_new_with_label ("Change Anchor");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (change_anchor_clicked), NULL);
w = gtk_button_new_with_label ("Change Widget");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (change_widget_clicked), NULL);
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
- gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), hbox);
gtk_widget_show (hbox);
w = gtk_button_new_with_label ("Hide Canvas");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (hide_canvas_clicked), NULL);
w = gtk_button_new_with_label ("Show Canvas");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (show_canvas_clicked), NULL);
w = gtk_button_new_with_label ("Hide Item");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (hide_item_clicked), NULL);
w = gtk_button_new_with_label ("Show Item");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (show_item_clicked), NULL);
w = gtk_button_new_with_label ("Change Transform");
- gtk_box_pack_start (GTK_BOX (hbox), w, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (hbox), w);
gtk_widget_show (w);
g_signal_connect (w, "clicked", G_CALLBACK (change_transform_clicked), NULL);
@@ -348,7 +348,11 @@ main ()
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_win),
GTK_SHADOW_IN);
gtk_widget_show (scrolled_win);
- gtk_box_pack_start (GTK_BOX (vbox), scrolled_win, TRUE, TRUE);
+ gtk_box_pack_start (GTK_BOX (vbox), scrolled_win);
+ gtk_widget_set_halign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_valign (scrolled_win, GTK_ALIGN_FILL);
+ gtk_widget_set_hexpand (scrolled_win, TRUE);
+ gtk_widget_set_vexpand (scrolled_win, TRUE);
canvas = goo_canvas_new ();
gtk_widget_set_can_focus (canvas, TRUE);
@@ -398,15 +402,15 @@ main ()
entry = gtk_entry_new ();
gtk_widget_show (entry);
- gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), entry);
entry = gtk_entry_new ();
gtk_widget_show (entry);
- gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), entry);
entry = gtk_entry_new ();
gtk_widget_show (entry);
- gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE);
+ gtk_box_pack_start (GTK_BOX (vbox), entry);
witem = goo_canvas_widget_new (root, vbox, 50, 600, -1, -1, NULL);
g_object_set_data (G_OBJECT (witem), "id", "vbox");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]