Re: GtkTreeView in VBox



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.



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