Add fix from Andrew Post for the adjustment

This commit is contained in:
Miguel de Icaza 2000-01-02 02:13:35 +00:00
parent 3f1f2611d8
commit ee4eabc27d

View File

@ -201,9 +201,19 @@ panel_fill_panel_list (WPanel *panel)
int i, col, type_col, color;
int width, p;
char **texts;
GtkAdjustment *va;
double clist_v_pos;
texts = g_new (char *, items + 1);
/* CList doesn't restore its vertical scroll position when its cleared,
* so we need to do it manually.
*/
/* Save the vertical position */
va = scrolled_window_get_vadjustment (panel->list);
clist_v_pos = va->value;
gtk_clist_freeze (GTK_CLIST (cl));
gtk_clist_clear (GTK_CLIST (cl));
@ -267,6 +277,9 @@ panel_fill_panel_list (WPanel *panel)
gtk_clist_set_column_width (cl, i, width);
}
/* Now restore the clist's vertical position */
gtk_adjustment_set_value (va, clist_v_pos);
gtk_clist_thaw (GTK_CLIST (cl));
}