Re: [gtk-list] DND with CList



Aaron Digulla wrote:
> 
> I'm writing a boomark sorter for Netscape bookmarks in Gtk.
> Basically, I show the Bookmark hierarchy on the left in a GtkTree
> and the Bookmarks themselves in a CList on the right. Now I
> want to do the same as in an Explorer on Windows: Click on an
> item in the CList to drag?drop it into a new folder in the Tree.
> How can I do this ?
> 
> --

Well! Now it is not only my problem... I asked the same questions
two times during last two weeks with no any reply :(
Generally, to drag-n-drop from/to widgets, both DND source and
target MUST have its own Gdk window, must be specified as drag
source or drop target (see testgtk.c from distribution) by
calling gtk_widget_dnd_drag_set(...) or gtk_widget_dnd_drop_set(...)
I trying it but it was not works :( 

Wow! GtkCList has 3 (three!) Gdk windows, and widget->window used
in gtk_widget_dnd_drag_set(...) is not the window containing rows;
it is the main GtkCList window. So, you can't use this function,
but you can use another call:

gdk_window_dnd_drag_set(GTK_CLIST(clist_widget)->clist_window, ... as
usual);

At second, if your GtkTree contains folders used as drop targets, do NOT
specify the GtkTree widget as drop target. More easily way may be
to call gtk_widget_dnd_drop_set(...) for each tree item created in the
tree...

Sorry for my poor English, but I have another one question. I lost three
days to find how to do DND from CList... In such case I will be pleased
if I can find anything about it in documentation.

Another DND problem is that dragging event occurs only when mouse
cursor leaves drag source widget, so, dragging from CList may looks
so ugly...

Sorry again. I think, the ability to add/remove or hide/show columns
of CList may be very useful. Using zero widths for "hidden" columns
isn't good way, I think...

Best wishes, 

Andrew.



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