Commit ba97b146 authored by Federico Mena Quintero's avatar Federico Mena Quintero Committed by Federico Mena Quintero
Browse files

Connect to the "changed" callback of the adjustment. We need to redraw the

2000-11-27  Federico Mena Quintero  <federico@helixcode.com>

	* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
	the "changed" callback of the adjustment.  We need to redraw the
	spin button's arrows when the adjustment's range changes.
	(adjustment_changed_cb): Draw the arrows.
	(gtk_spin_button_value_changed): Draw the arrows.
parent 1c805555
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
2000-11-27 Federico Mena Quintero <federico@helixcode.com>
* gtk/gtkspinbutton.c (gtk_spin_button_set_adjustment): Connect to
the "changed" callback of the adjustment. We need to redraw the
spin button's arrows when the adjustment's range changes.
(adjustment_changed_cb): Draw the arrows.
(gtk_spin_button_value_changed): Draw the arrows.
2000-11-23 Alexander Larsson <alexl@redhat.com> 2000-11-23 Alexander Larsson <alexl@redhat.com>
* gdk/linux-fb/gdkselection-fb.c: * gdk/linux-fb/gdkselection-fb.c:
......
...@@ -1047,6 +1047,9 @@ gtk_spin_button_value_changed (GtkAdjustment *adjustment, ...@@ -1047,6 +1047,9 @@ gtk_spin_button_value_changed (GtkAdjustment *adjustment,
&return_val); &return_val);
if (return_val == FALSE) if (return_val == FALSE)
gtk_spin_button_default_output (spin_button); gtk_spin_button_default_output (spin_button);
gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_UP);
gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_DOWN);
} }
static gint static gint
...@@ -1404,6 +1407,20 @@ gtk_spin_button_new (GtkAdjustment *adjustment, ...@@ -1404,6 +1407,20 @@ gtk_spin_button_new (GtkAdjustment *adjustment,
return GTK_WIDGET (spin); return GTK_WIDGET (spin);
} }
/* Callback used when the spin button's adjustment changes. We need to redraw
* the arrows when the adjustment's range changes.
*/
static void
adjustment_changed_cb (GtkAdjustment *adjustment, gpointer data)
{
GtkSpinButton *spin_button;
spin_button = GTK_SPIN_BUTTON (data);
gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_UP);
gtk_spin_button_draw_arrow (spin_button, GTK_ARROW_DOWN);
}
void void
gtk_spin_button_set_adjustment (GtkSpinButton *spin_button, gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
GtkAdjustment *adjustment) GtkAdjustment *adjustment)
...@@ -1426,6 +1443,9 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button, ...@@ -1426,6 +1443,9 @@ gtk_spin_button_set_adjustment (GtkSpinButton *spin_button,
gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed", gtk_signal_connect (GTK_OBJECT (adjustment), "value_changed",
(GtkSignalFunc) gtk_spin_button_value_changed, (GtkSignalFunc) gtk_spin_button_value_changed,
(gpointer) spin_button); (gpointer) spin_button);
gtk_signal_connect (GTK_OBJECT (adjustment), "changed",
(GtkSignalFunc) adjustment_changed_cb,
(gpointer) spin_button);
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment