* @max: maximum value
* @step: step increment (tick size) used with keyboard shortcuts
*
- * Creates a new horizontal scale widget that lets the user
- * input a number between @min and @max with the increment @step.
- * @step must be nonzero; it's the distance the slider moves when
- * using the arrow keys to adjust the scale value.
+ * Creates a new horizontal scale widget that lets the user input a
+ * number between @min and @max (including @min and @max) with the
+ * increment @step. @step must be nonzero; it's the distance the
+ * slider moves when using the arrow keys to adjust the scale value.
*
* Return value: a new #GtkHScale
**/
g_return_val_if_fail (min < max, NULL);
g_return_val_if_fail (step != 0.0, NULL);
- adj = gtk_adjustment_new (min, min, max, step, 10 * step, step);
+ adj = gtk_adjustment_new (min, min, max, step, 10 * step, 0);
scale = g_object_new (GTK_TYPE_HSCALE,
"adjustment", adj,
range = GTK_RANGE (widget);
scale = GTK_SCALE (widget);
hscale = GTK_HSCALE (widget);
-
+
+ /* We need to chain up _first_ so the various geometry members of
+ * GtkRange struct are updated.
+ */
+ if (GTK_WIDGET_CLASS (parent_class)->expose_event)
+ GTK_WIDGET_CLASS (parent_class)->expose_event (widget, event);
+
if (scale->draw_value)
{
PangoLayout *layout;
y = 0;
break;
}
+
+ x += widget->allocation.x;
+ y += widget->allocation.y;
state_type = GTK_STATE_NORMAL;
if (!GTK_WIDGET_IS_SENSITIVE (scale))
g_object_unref (G_OBJECT (layout));
}
-
- return (* GTK_WIDGET_CLASS (parent_class)->expose_event) (widget, event);
+
+ return FALSE;
}