Re: GtkTreeView and scroll bar
- From: Federico Mena Quintero <federico ximian com>
- To: Javier Fernandez <jfernandez igalia com>
- Cc: GTK+ development mailing list <gtk-devel-list gnome org>
- Subject: Re: GtkTreeView and scroll bar
- Date: Fri, 19 Mar 2004 13:27:34 -0600
On Thu, 2004-03-18 at 10:44, Javier Fernandez wrote:
> Hi, thanks for your attention and excuse my poor english.
> I'm working on a window with various GtkTreeView and some drag&drop
> functionalities. I want to enable dnd operation beetwen thes tree views
> and inside one tree view. But my problem is to move the scrollbar while
> drag data have being moved accross the destination tree view to find the
> appropiate row on which insert the data.
If you use a GtkListStore or GtkTreeStore as your data model, you may be
able to just use gtk_tree_view_enable_model_drag_source() and
gtk_tree_view_enable_model_drag_dest() to enable automatic
drag-and-drop. You may also need to do this:
1. Create a derived class from GtkListStore or GtkTreeStore
2. Create your own custom implementations of GtkTreeDragSourceIface or
GtkTreeDragDestIface, overriding the default ones.
If you use gtk_tree_view_enable_model_drag_dest(), then the tree will be
scrolled automatically when you drag over it.
If this doesn't fit your needs, you have to handle the GtkWidget
drag-and-drop signals yourself. GtkTreeView has some helper functions
that you can use to figure out the destination row and such; see
gtk_tree_view_get_dest_row_at_pos(), for example. Scrolling by hand is
more complicated; you should look at the GtkTreeView sources to see how
it's done.
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]