summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ae6ef4)
raw | patch | inline | side by side (parent: 4ae6ef4)
author | scislac <scislac@users.sourceforge.net> | |
Sat, 3 Oct 2009 20:52:44 +0000 (20:52 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Sat, 3 Oct 2009 20:52:44 +0000 (20:52 +0000) |
src/widgets/desktop-widget.cpp | patch | blob | history |
index 0bf09410ddceeaf58c6768e4154387a51d73c164..5fd32487f2e375091aa2f85e203eb1e3ca65bc46 100644 (file)
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