Re: DND on GTK - cancel attempt



"Veronika Irvine" <Veronika_Irvine oti com> writes:
> To allow a widget to participate as a drag source I have two options 1) gtk_drag_source_set and 2) gtk_drag_begin.
> 
> What I want to be able to do is when the conditions are right for a drag 
> to begin, I want to check if I indeed want to perform a drag (e.g. do I 
> have anything selected to drag).
> If I have nothing to drag, I do not want to proceed. 
> 
>  As far as I can gather, if I use gtk_drag_source_set I will be notified 
> in my drag_begin callback that the conditions for a drag to start have 
> been met.  But I can see no way in the drag_begin callback to abort the 
> operation (in fact calling gdk_drag_abort does not work and there is no 
> return value to indicate failure). 
> 
> Alternatively, I can detect that a DND operation may begin and then call 
> gtk_drag_begin but since the user can possibly configure the timing, 
> button used, distance moved etc I really can't do a good job of figuring 
> out when the DND operation may begin.

I believe if you use drag_source_set you can't customize when the drag
begins. You need to begin the drag yourself in that
case. gtktreeview.c contains an example.

There's a gtk_drag_check_threshold() function you should use to be
sure you're using a consistent drag threshold.

Havoc




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