From c4b771b8e5e1a7c6076f39f811b923030c7a0a19 Mon Sep 17 00:00:00 2001 From: GMT 2003 Tony Gale Date: Thu, 23 Jan 2003 21:07:42 +0000 Subject: docs/tutorial/gtk-tut.sgml: Adopted chapter 21.3 "Creating a Composite Thu Jan 23 20:56:56 GMT 2003 Tony Gale * Sebastian Rittau : docs/tutorial/gtk-tut.sgml: Adopted chapter 21.3 "Creating a Composite widget" to modern standards. (I.e. use gobject instead of glib, derive from GtkTable instead of GtkVBox.) Bugzilla #103869. * docs/tutorial/gtk-tut.sgml, examples/tictactoe: Fixup tic-tac-toe code in Appendix C to reflect above changes. * examples/rangewidgets/rangewidgets.c: From Roger Leigh auto resize on page size change --- examples/gtkdial/gtkdial.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'examples/gtkdial') diff --git a/examples/gtkdial/gtkdial.c b/examples/gtkdial/gtkdial.c index f557800d0..76526d673 100644 --- a/examples/gtkdial/gtkdial.c +++ b/examples/gtkdial/gtkdial.c @@ -146,7 +146,7 @@ gtk_dial_destroy (GtkObject *object) dial = GTK_DIAL (object); - if (dial->adjustment) + if (dial->adjustment) { g_object_unref (GTK_OBJECT (dial->adjustment)); dial->adjustment = NULL; @@ -353,7 +353,7 @@ gtk_dial_expose (GtkWidget *widget, if ((upper - lower) == 0) return FALSE; - increment = (100*G_PI) / (dial->radius*dial->radius); + increment = (100*M_PI) / (dial->radius*dial->radius); inc = (upper - lower); @@ -363,7 +363,7 @@ gtk_dial_expose (GtkWidget *widget, for (i = 0; i <= inc; i++) { - theta = ((gfloat)i*G_PI / (18*inc/24.) - G_PI/6.); + theta = ((gfloat)i*M_PI / (18*inc/24.) - M_PI/6.); if ((theta - last) < (increment)) continue; @@ -558,17 +558,17 @@ gtk_dial_update_mouse (GtkDial *dial, gint x, gint y) old_value = dial->adjustment->value; dial->angle = atan2(yc-y, x-xc); - if (dial->angle < -G_PI/2.) - dial->angle += 2*G_PI; + if (dial->angle < -M_PI/2.) + dial->angle += 2*M_PI; - if (dial->angle < -G_PI/6) - dial->angle = -G_PI/6; + if (dial->angle < -M_PI/6) + dial->angle = -M_PI/6; - if (dial->angle > 7.*G_PI/6.) - dial->angle = 7.*G_PI/6.; + if (dial->angle > 7.*M_PI/6.) + dial->angle = 7.*M_PI/6.; - dial->adjustment->value = dial->adjustment->lower + (7.*G_PI/6 - dial->angle) * - (dial->adjustment->upper - dial->adjustment->lower) / (4.*G_PI/3.); + dial->adjustment->value = dial->adjustment->lower + (7.*M_PI/6 - dial->angle) * + (dial->adjustment->upper - dial->adjustment->lower) / (4.*M_PI/3.); if (dial->adjustment->value != old_value) { @@ -615,7 +615,7 @@ gtk_dial_update (GtkDial *dial) g_signal_emit_by_name (GTK_OBJECT (dial->adjustment), "value_changed"); } - dial->angle = 7.*G_PI/6. - (new_value - dial->adjustment->lower) * 4.*G_PI/3. / + dial->angle = 7.*M_PI/6. - (new_value - dial->adjustment->lower) * 4.*M_PI/3. / (dial->adjustment->upper - dial->adjustment->lower); gtk_widget_queue_draw (GTK_WIDGET (dial)); -- cgit v1.2.1