Re: GtkTreeView in VBox



Hi,
I have also faced a similar situation in which case i need to pack a treeview inside a VBox. I would not mind the treeview apis not working but the packing is something i am looking to keep. The scrolling of the VBox works fine for smaller sizes of the TreeView. But when the treeview consists of elements greater than a certain number of elements (450) in my case, the scrolling goes awry between adjustment values 16000 and 27000 (sounds strange, i know.).

Please help. Any suggestion is welcome.
Thank you for your time.


Kristian Rietveld wrote:
On Thu, Jan 7, 2010 at 1:24 PM, Amol Kulkarni <amolgkulkarni gmail com> wrote:
Is it possible to add GtkTreeView inside VBox and then add that VBox to
ScrolledWindow using gtk_scrolled_window_add_with_viewport(sw,vbox).

Is this expected/supported use case or am i doing something wrong here?
Thanks for your time.

No, it's not a supported use case.  GtkTreeView and other scrolling
widgets such as GtkIconView are meant to be placed directly in a
GtkScrolledWindow.  Not doing so will, for example, break scroll
commands given by GtkTreeView itself, since it is not directly
connected to the GtkScrolledWindow anymore.  Such scroll commands are
given when you are setting a cursor on a row and want to make that row
visible, automatic scrolling during drag selection, or by the
application programmer using the gtk_tree_view_scroll_to_cell() and
related functions, etc.

Another reason why this is a bad idea is memory usage, although I
cannot tell for sure whether this still holds for GTK+ 2.18 and later.
 For earlier versions of GTK+ a large X window has to be allocated if
you are placing a GtkTreeView with a large number of rows in a VBox or
similar container.


regards,

-kris.
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]