[Gazpacho] [Fwd: Re: [Gazpacho-commits] r1724 - in gazpacho/trunk: . gazpacho]

Mattias Karlsson enkidude at gmail.com
Wed Aug 31 22:37:57 CEST 2005


On 8/30/05, Johan Dahlin <johan at gnome.org> wrote:
> 
> > Otherwise the drop region isn't cleared when we're leaving the widget.
> > Is there a better way of doing it? Do you want a comment?
> 
> Right, but why isn't it cleared? Why do we have to do it manually?
> Fine if you don't know, I'm just curious :)


I don't know that much about the gtk drawing model but I can make a guess. 
:)

When a widget is dragged over another widget a drop region will be 
calculated. This is stored in the target widget and when we get an expose 
event this region will be painted ontop of the target widget. 

When the drag leaves the target widget a 'drag_leave' event will be emitted. 
When this happens the drop region, stored in the target widget, will be set 
to None. The next time the expose event is emitted the widget will be drawn 
as usual, without the drop region. Since the region is still painted when we 
get the 'drag_leave' event we have to invalidate the widget area by calling 
Widget.queue_draw().

Please correct me if I have misunderstood everything. :)

>>Where is "NONE" coming from? Is it a constant?
> >
> >
> > Good question. I thought drag_dest_find_target would return None, but
> > instead it returned the string "NONE".
> 
> Probably from Gtk+ itself, but a constant would be nice, with a comment 
> :-)


Sure thing. 

>>Do you need both checks? the parenthesis is not neccessary.
> >
> >
> > I'm not sure actually. The 'not gwidget' check was used in
> > _dnd_drag_data_received_cb and I just added the second check. The
> > parenthesis can of course be removed if you want.
> 
> Fine I guess, do what you like.
> 

I'll leave it as it is for now. The whole dnd code is still fairly 
experimental. I plan on going over it and clean it up when it stabilize a 
bit (unless someone beats me to it of course).

/ Mattias
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://sicem.biz/pipermail/gazpacho/attachments/20050831/b22dbd6f/attachment.html


More information about the Gazpacho mailing list