[gtk+] Use gtk_scale_new_with_range() instead gtk_[v|h]scale_new_with_range()
- From: Javier Jardón <jjardon src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Use gtk_scale_new_with_range() instead gtk_[v|h]scale_new_with_range()
- Date: Sat, 30 Oct 2010 00:27:00 +0000 (UTC)
commit 8177ad320e19a5800ccb2d9d0b79dfe7dc334486
Author: Javier Jardón <jjardon gnome org>
Date: Sat Oct 30 02:01:27 2010 +0200
Use gtk_scale_new_with_range() instead gtk_[v|h]scale_new_with_range()
demos/gtk-demo/offscreen_window.c | 3 ++-
docs/tools/widgets.c | 6 ++++--
gtk/tests/testing.c | 3 ++-
tests/testellipsise.c | 3 ++-
tests/testgtk.c | 3 ++-
tests/testoffscreen.c | 5 ++---
tests/testscale.c | 30 ++++++++++++++++++++----------
7 files changed, 34 insertions(+), 19 deletions(-)
---
diff --git a/demos/gtk-demo/offscreen_window.c b/demos/gtk-demo/offscreen_window.c
index 410f524..fda8d83 100644
--- a/demos/gtk-demo/offscreen_window.c
+++ b/demos/gtk-demo/offscreen_window.c
@@ -561,7 +561,8 @@ do_offscreen_window (GtkWidget *do_widget)
gtk_container_set_border_width (GTK_CONTAINER (window), 10);
vbox = gtk_vbox_new (0, FALSE);
- scale = gtk_hscale_new_with_range (0, G_PI/2, 0.01);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, G_PI/2, 0.01);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
button = gtk_button_new_with_label ("A Button");
diff --git a/docs/tools/widgets.c b/docs/tools/widgets.c
index 4c049fd..3227eb4 100644
--- a/docs/tools/widgets.c
+++ b/docs/tools/widgets.c
@@ -947,10 +947,12 @@ create_scales (void)
vbox = gtk_vbox_new (FALSE, 3);
hbox = gtk_hbox_new (TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
- gtk_hscale_new_with_range (0.0, 100.0, 1.0),
+ gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0.0, 100.0, 1.0),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (hbox),
- gtk_vscale_new_with_range (0.0, 100.0, 1.0),
+ gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0.0, 100.0, 1.0),
TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox), hbox, TRUE, TRUE, 0);
gtk_box_pack_start (GTK_BOX (vbox),
diff --git a/gtk/tests/testing.c b/gtk/tests/testing.c
index fc42442..bc002f6 100644
--- a/gtk/tests/testing.c
+++ b/gtk/tests/testing.c
@@ -76,7 +76,8 @@ test_slider_ranges (void)
{
GtkWidget *child;
GtkWidget *window = gtk_test_create_simple_window ("Test Window", "Test: gtk_test_warp_slider");
- GtkWidget *hscale = gtk_hscale_new_with_range (-50, +50, 5);
+ GtkWidget *hscale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ -50, +50, 5);
child = gtk_bin_get_child (GTK_BIN (window));
gtk_container_add (GTK_CONTAINER (child), hscale);
diff --git a/tests/testellipsise.c b/tests/testellipsise.c
index 973b955..b9a92c2 100644
--- a/tests/testellipsise.c
+++ b/tests/testellipsise.c
@@ -137,7 +137,8 @@ main (int argc, char *argv[])
gtk_container_add (GTK_CONTAINER (window), vbox);
combo = gtk_combo_box_text_new ();
- scale = gtk_hscale_new_with_range (0, 360, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 360, 1);
label = gtk_label_new ("This label may be ellipsized\nto make it fit.");
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (combo), "NONE");
diff --git a/tests/testgtk.c b/tests/testgtk.c
index b621b9a..1665481 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -2107,7 +2107,8 @@ create_rotated_label (GtkWidget *widget)
gtk_label_set_markup (GTK_LABEL (scale_label), "<i>Angle: </i>");
gtk_box_pack_start (GTK_BOX (scale_hbox), scale_label, FALSE, FALSE, 0);
- hscale = gtk_hscale_new_with_range (0, 360, 5);
+ hscale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 360, 5);
g_signal_connect (hscale, "value-changed",
G_CALLBACK (on_angle_scale_changed), label);
diff --git a/tests/testoffscreen.c b/tests/testoffscreen.c
index cfb285b..60f8ee1 100644
--- a/tests/testoffscreen.c
+++ b/tests/testoffscreen.c
@@ -310,9 +310,8 @@ main (int argc,
vbox = gtk_vbox_new (0, FALSE);
gtk_container_add (GTK_CONTAINER (window), vbox);
- scale = gtk_hscale_new_with_range (0,
- G_PI * 2,
- 0.01);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, G_PI * 2, 0.01);
gtk_box_pack_start (GTK_BOX (vbox), scale, FALSE, FALSE, 0);
button = gtk_button_new_with_label ("Remove child 2");
diff --git a/tests/testscale.c b/tests/testscale.c
index 98e83f0..3ed22b2 100755
--- a/tests/testscale.c
+++ b/tests/testscale.c
@@ -49,13 +49,15 @@ int main (int argc, char *argv[])
box = gtk_vbox_new (FALSE, 5);
frame = gtk_frame_new ("No marks");
- scale = gtk_hscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Simple marks");
- scale = gtk_hscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_BOTTOM, NULL);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, NULL);
@@ -64,7 +66,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Labeled marks");
- scale = gtk_hscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_BOTTOM, labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, labels[1]);
@@ -73,7 +76,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Some labels");
- scale = gtk_hscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_BOTTOM, labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_BOTTOM, NULL);
@@ -82,7 +86,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Above and below");
- scale = gtk_hscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_HORIZONTAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[0], GTK_POS_TOP, bath_labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[1], GTK_POS_BOTTOM, bath_labels[1]);
@@ -95,13 +100,15 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box), box2, TRUE, TRUE, 0);
frame = gtk_frame_new ("No marks");
- scale = gtk_vscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_container_add (GTK_CONTAINER (frame), scale);
gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Simple marks");
- scale = gtk_vscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_LEFT, NULL);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_LEFT, NULL);
@@ -110,7 +117,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Labeled marks");
- scale = gtk_vscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_LEFT, labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_LEFT, labels[1]);
@@ -119,7 +127,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Some labels");
- scale = gtk_vscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), marks[0], GTK_POS_LEFT, labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), marks[1], GTK_POS_LEFT, NULL);
@@ -128,7 +137,8 @@ int main (int argc, char *argv[])
gtk_box_pack_start (GTK_BOX (box2), frame, FALSE, FALSE, 0);
frame = gtk_frame_new ("Right and left");
- scale = gtk_vscale_new_with_range (0, 100, 1);
+ scale = gtk_scale_new_with_range (GTK_ORIENTATION_VERTICAL,
+ 0, 100, 1);
gtk_scale_set_draw_value (GTK_SCALE (scale), FALSE);
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[0], GTK_POS_RIGHT, bath_labels[0]);
gtk_scale_add_mark (GTK_SCALE (scale), bath_marks[1], GTK_POS_LEFT, bath_labels[1]);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]