RE: List Scrolling
- From: "Ian Puleston" <ian underpressuredivers com>
- To: <gtk-list gnome org>
- Subject: RE: List Scrolling
- Date: Wed, 26 Nov 2008 16:15:09 -0800
> -----Original Message-----
> From: Demetris Zavorotnichenko
> Ok, I got the scrolling window to scroll from my mouse.
> But I have another problem now.
> I need to set the vadhustment on the window as soon as I create it, so
> the window is in the center and not in the beginning.
> But when I do :
> Gtk_adjustment *adj = gtk_scrolled_window_get_vadjustment
> (GTK_SCROLLED_WINDOW (mywindow));
> Double value = gtk_adjustment_get_value (adj);
> Gtk_adjustment_set_value (adj, value);
> Gtk_scrolled_window_set_vadjustment(GTK_SCROLLED_WINDOW (mywindow),
> Nothing happends, it doesn't change. But if I put this in a callback
> like "motion-notify-event" this works fine.
> The thing is that I don't want it to execute in a callback, but after I
> created and added my Widget to the windows' Container.
> How can I fix this ?
I had exactly the same problem, which appeared to be because I was trying to
scroll it before the window had completed building the display. What I did
back then to work around the problem was this - after loading the text into
the window I have:
/* We must now wait a bit for the window to be ready before we can
scroll it */
g_timeout_add(50, doneTimer, G_POINTER(errCode));
And in that timer callback I basically do exactly what you have above.
] [Thread Prev