diff options
| author | Josh Andler <scislac@gmail.com> | 2009-10-03 20:52:44 +0000 |
|---|---|---|
| committer | scislac <scislac@users.sourceforge.net> | 2009-10-03 20:52:44 +0000 |
| commit | 3fd31c30af0986d1682bcd14632c6711dce0dae2 (patch) | |
| tree | ab1633e06a5422d22522d6c8676372489d4731a4 /src/widgets | |
| parent | * [INTL: it] Some progress for today (diff) | |
| download | inkscape-3fd31c30af0986d1682bcd14632c6711dce0dae2.tar.gz inkscape-3fd31c30af0986d1682bcd14632c6711dce0dae2.zip | |
Patch by Max for 264709.
(bzr r8706)
Diffstat (limited to 'src/widgets')
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
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 |
