Commit ba5fbdb3 authored by Christian Dywan's avatar Christian Dywan

Bug 555523 – gtk_scale_button_set_adjustment should accept NULL

* gtk/gtkscalebutton.c (gtk_scale_button_set_adjustment):
Create a new adjustment if NULL is passed, like other widgets

svn path=/trunk/; revision=21620
parent 78be7a0a
2008-10-09 Christian Dywan <christian@imendio.com>
Bug 555523 – gtk_scale_button_set_adjustment should accept NULL
* gtk/gtkscalebutton.c (gtk_scale_button_set_adjustment):
Create a new adjustment if NULL is passed, like other widgets
2008-10-09 Christian Dywan <christian@imendio.com>
Bug 555578 – GtkTable propertiy maxima are wrong
......
......@@ -678,16 +678,22 @@ gtk_scale_button_set_adjustment (GtkScaleButton *button,
GtkAdjustment *adjustment)
{
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
if (!adjustment)
adjustment = (GtkAdjustment*) gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0);
else
g_return_if_fail (GTK_IS_ADJUSTMENT (adjustment));
if (button->priv->adjustment)
g_object_unref (button->priv->adjustment);
button->priv->adjustment = g_object_ref_sink (adjustment);
if (button->priv->adjustment != adjustment)
{
if (button->priv->adjustment)
g_object_unref (button->priv->adjustment);
button->priv->adjustment = g_object_ref_sink (adjustment);
if (button->priv->scale)
gtk_range_set_adjustment (GTK_RANGE (button->priv->scale), adjustment);
if (button->priv->scale)
gtk_range_set_adjustment (GTK_RANGE (button->priv->scale), adjustment);
g_object_notify (G_OBJECT (button), "adjustment");
g_object_notify (G_OBJECT (button), "adjustment");
}
}
/**
......
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