From: scislac Date: Sat, 3 Oct 2009 20:52:44 +0000 (+0000) Subject: Patch by Max for 264709. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=39840784fd1aebd06249469062c5e47774e782a7;p=inkscape.git Patch by Max for 264709. --- diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index 0bf09410d..5fd32487f 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -1283,11 +1283,19 @@ SPDesktopWidget::setToolboxFocusTo (const gchar* label) void SPDesktopWidget::setToolboxAdjustmentValue (gchar const *id, double value) { + GtkAdjustment *a = NULL; gpointer hb = sp_search_by_data_recursive (aux_toolbox, (gpointer) id); - if (hb && GTK_IS_WIDGET(hb) && GTK_IS_SPIN_BUTTON(hb)) { - GtkAdjustment *a = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(hb)); - gtk_adjustment_set_value (a, value); + if (hb && GTK_IS_WIDGET(hb)) { + if (GTK_IS_SPIN_BUTTON(hb)) + a = gtk_spin_button_get_adjustment (GTK_SPIN_BUTTON(hb)); + else if (GTK_IS_RANGE(hb)) + a = gtk_range_get_adjustment (GTK_RANGE(hb)); } + + if (a) + gtk_adjustment_set_value (a, value); + else + g_warning ("Could not find GtkAdjustment for %s\n", id); } void