diff options
author | GMT 2003 Tony Gale <gale@gtk.org> | 2003-01-23 21:07:42 +0000 |
---|---|---|
committer | Tony Gale <gale@src.gnome.org> | 2003-01-23 21:07:42 +0000 |
commit | c4b771b8e5e1a7c6076f39f811b923030c7a0a19 (patch) | |
tree | 4b8f9352079792f5a3e359d9fdf8c800d5259ba1 /examples | |
parent | 06116092cf5335fa57e95c9032b7777ececcef82 (diff) | |
download | gdk-pixbuf-c4b771b8e5e1a7c6076f39f811b923030c7a0a19.tar.gz |
docs/tutorial/gtk-tut.sgml: Adopted chapter 21.3 "Creating a Composite
Thu Jan 23 20:56:56 GMT 2003 Tony Gale <gale@gtk.org>
* Sebastian Rittau <srittau@jroger.in-berlin.de>:
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
Diffstat (limited to 'examples')
-rw-r--r-- | examples/buttonbox/buttonbox.c | 2 | ||||
-rw-r--r-- | examples/gtkdial/gtkdial.c | 24 |
2 files changed, 13 insertions, 13 deletions
diff --git a/examples/buttonbox/buttonbox.c b/examples/buttonbox/buttonbox.c index a3c012c04..c70700ac7 100644 --- a/examples/buttonbox/buttonbox.c +++ b/examples/buttonbox/buttonbox.c @@ -43,7 +43,7 @@ GtkWidget *create_bbox( gint horizontal, int main( int argc, char *argv[] ) { - GtkWidget *window; + static GtkWidget* window = NULL; GtkWidget *main_vbox; GtkWidget *vbox; GtkWidget *hbox; 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)); |