On Tue, 2007-02-06 at 21:40 +0100, Mehmet YASAR wrote: > Hi, > > I need some advice about scrolled views. > > I have a gtkscrolledview containing a gtkvbox, I'm adding many > gtktextviews to the vbox. I'd like to select which gtktextview is > displayed when I call gtk_widget_show(gkvbox). > > The problem I have is related to the fact that each widget have a > different height, so "size negociation" with the gtkvbox takes many steps. > > I can't find the FINAL height of the gtkvbox (after all the widgets have > been added and their height allocated), so I am unable to scroll to the > correct position before gtk_widget_show.
If you have caused the GtkVBox to be Realized, meaning all the widget have done their size negotiations, then to get the x/y position of the desired GtkTextView - relative to the GtkVBox, you can try something like this. if ( GTK_WIDGET_REALIZED(gvbox) ) { GTK_WIDGET(gkvbox)->allocation.height; /* this is the allocated height */ GTK_WIDGET(desired_gtktextview)->allocation.y; /* this would be your scroll to point to display this widget */ /* this point is inside the gvbox's height range */ } Hope this helps James, > > Can someone help me ? > _______________________________________________ > gtk-app-devel-list mailing list > gtk-app-devel-list@gnome.org > http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list James Scott, Jr. Registered Linux User #270764 FC6 on Dual AMD-MP 2400+ Author: {gfhcm, gkrellfah2,gapcmon,giw}.sourceforge.net http://mysite.verizon.net/skoona/index.html
_______________________________________________ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list