GtkClist GtkScrolledWindow and initial position
- From: Jason Majors <whizzird yahoo com>
- To: gtk-app-devel-list gnome org
- Subject: GtkClist GtkScrolledWindow and initial position
- Date: Mon, 26 Feb 2001 15:23:05 -0800 (PST)
I have a GtkCList that is inside of a
GtkScrolledWindow (via gtk_container_add) that I would
like to have scroll down some (if needed) to display a
default selection.
Here's the code I have (the Clist has already been
populated and thawed):
/* Create the scroll bar window. */
scrollWindow = gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrollWindow),
GTK_POLICY_AUTOMATIC,
GTK_POLICY_ALWAYS);
gtk_widget_set_usize(scrollWindow, 350, 3
00);
/* Add the list box to the scroll window. */
gtk_clist_select_row(GTK_CLIST(listBox), index, 0);
gtk_container_add(GTK_CONTAINER(scrollWindow),
listBox);
/* Move the scroll window to show the default
selection. */
vAdj =
gtk_scrolled_window_get_vadjustment(GTK_SCROLLED_WINDOW(scrollWindow));
newValue = (vAdj->upper + vAdj->lower) / 2.0f;
gtk_adjustment_set_value(vAdj, newValue);
gtk_adjustment_value_changed(vAdj);
Then there's some signal connection and both objects
are shown.
Can anyone tell me what I'm doing wrong here? Or
better yet, the right way to do it?
Thanks,
Jason
__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]