Re: Gtk_CTree : Help please
- From: "Florent. Devin" <Florent Devin lifl fr>
- To: GTK List <gtk-list gnome org>
- Subject: Re: Gtk_CTree : Help please
- Date: Fri, 04 Aug 2000 09:44:21 +0200
Vlad Harchev a écrit :
> > But with this method, I can not still handle signal for different
> > gtk_ctree_node ? If I can not handle signal, I can not do drag and drop
> > from
> > another widget to a particular node.
>
> If you mean that you want to be able to drag something from other widget
> (other ctree for example) to given ctree - yes, seems some tricky things will
> be required to do this. Look at testdnd.c supplied in gtk sources. You will
> have to do just the same (using "drag_drop" and "drag-data-received"), and in
> handler for "drag-data-received" you will have to compute the row number of
> the target it using
>
> int row, column;
> gtk_clist_get_selection_info(GTK_CLIST(root_ctree),x,y,&row,&column);
> After that you can (I guess) get the target CTreeNode using
> gtk_ctree_node_nth(GTK_CTREE(root_ctree),row)
>
> Please report whether this really works.
>
> If you need only dragging from nodes of that ctree to nodes of the same ctree
> (better called reordering) - then it's easily doable (look at testgtk.c).
>
> > There is one function that may help me but I do not know what it is for
> > :
> > gtk_ctree_set_drag_compare_func
> > Or is there a way to handle drag and drop signal ?
> > Is there a way to handle at least signal from gtk_widget ?
> >
What I have to do is :
- To drag a particular node from a ctree to another ctree or to the
same
but in another location (changing the parent...)
- To drag from a canvas and drop onto a particular node
- To drag from ctree to my canvas.
So I can handle the signal from "drag-data-received" but how can I be
sure that the current selected item is the item I what to drag ?
How can I know where I drop my drag object ?
I had a similar problem in canvas, where gnome-canvas-image are not from
GtkWidget, the thing I have to do is to handle signal from the canvas
itself and react if I was on an image or not. This was possible because
gnome-canvas had function to know what we have under the pointer ?
--
Florent DEVIN
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]