Re: Automatically scrolling a ScrolledWindow




On Dec 5, 2006, at 11:40 PM, Daniel Kasak wrote:

I have a big treeview that requires a scrolled window that scrolls in
both directions. When editing data in the treeview, the scrolled window doesn't automatically scroll horizontally to follow the current cell, so I have to manually scroll it ( ie horizontally ) with the mouse. How do
I make the scrolled window scroll horizontally when appropriate ... ie
when the active cell isn't visible because it needs to be scrolled?


gtk_tree_view_scroll_to_cell() for the win!

http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeView.html#gtk-tree- view-scroll-to-cell


Make sure not to pass undef for the column, e.g.

   # we're already on the row, so just make sure this column is visible
   $tree_view->scroll_to_cell (undef, $column, FALSE, 0.0, 0.0);


Remember that you can get the column, if you don't already have it, by asking for it:

   $column = $tree_view->get_column ($index);






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