mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-13 04:10:13 +00:00
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
This commit is contained in:
parent
78be7a0a34
commit
ba5fbdb32b
@ -1,3 +1,10 @@
|
|||||||
|
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>
|
2008-10-09 Christian Dywan <christian@imendio.com>
|
||||||
|
|
||||||
Bug 555578 – GtkTable propertiy maxima are wrong
|
Bug 555578 – GtkTable propertiy maxima are wrong
|
||||||
|
@ -678,16 +678,22 @@ gtk_scale_button_set_adjustment (GtkScaleButton *button,
|
|||||||
GtkAdjustment *adjustment)
|
GtkAdjustment *adjustment)
|
||||||
{
|
{
|
||||||
g_return_if_fail (GTK_IS_SCALE_BUTTON (button));
|
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)
|
if (button->priv->adjustment != adjustment)
|
||||||
g_object_unref (button->priv->adjustment);
|
{
|
||||||
button->priv->adjustment = g_object_ref_sink (adjustment);
|
if (button->priv->adjustment)
|
||||||
|
g_object_unref (button->priv->adjustment);
|
||||||
|
button->priv->adjustment = g_object_ref_sink (adjustment);
|
||||||
|
|
||||||
if (button->priv->scale)
|
if (button->priv->scale)
|
||||||
gtk_range_set_adjustment (GTK_RANGE (button->priv->scale), adjustment);
|
gtk_range_set_adjustment (GTK_RANGE (button->priv->scale), adjustment);
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (button), "adjustment");
|
g_object_notify (G_OBJECT (button), "adjustment");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user