DnD progress report

Rob Gayvert rtg at rochester.rr.com
Mon Oct 3 12:35:59 UTC 2005


Cees De Groot wrote:

>Source widget:
>
>handleMouseEventInList: aMouseEvent
>	aMouseEvent dragging
>		ifTrue: [
>			| data src result |
>			selectedFile ifNil: [^self].
>			data := WxFileDataObject new addFile: selectedFile qualifiedReference.
>			src := WxDropSource data: data.
>			result := src doDragDrop.
>		]
>		ifFalse: [
>			aMouseEvent skip]
>
>Target widget:
>
>initialize
>	[...]
>	self setDropTarget: (DGVMainTreeDropTarget new tree: self).
>
>DGVMainTreeDropTarget is a subclass of WxFileDropTarget.
>
>This results in:
>- drags can be started from the widget, but the whole application
>shows the 'forbidden' icon. I can drag onto a Windows file explorer
>window, however;
>- drags of a Windows file show that the #setDropTarget: works ok,
>because files can be dropped on the widget that set the drop target
>but nowhere else (and the drop target's callback is called back).
>
>Any idea what could be wrong?
>  
>
I haven't done much with dnd beyond the drag image sample and the built-in
support in wxGrid. In fact, given that some of the constructors of the 
source
and target classes are missing or wrong, I'm a bit surprised it works at 
all.

I worked up a simplified version of the C++ dnd sample application using 
only
file sources and targets, and I'm seeing results similar to yours. 
Dragging to
or from the desktop works fine, but between two widgets doesn't. Very 
odd. At
this point I don't see an easy fix.

.. Rob




More information about the Wxsqueak mailing list