[wxruby-development] [ wxruby-Bugs-26062 ] TreeCtrl and ListCtrl corrupt their own DropTarget

noreply at rubyforge.org
2009-05-29T12:36:46Z

Bugs item #26062, was opened at 2009-05-29 14:36
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=218&aid=26062&group_id=35

Category: Incorrect behavior
Group: current
Status: Open
Resolution: None
Priority: 3
Submitted By: Muriel Salvan (muriel)
Assigned to: Nobody (None)
Summary: TreeCtrl and ListCtrl corrupt their own DropTarget

Initial Comment:
Greetings

It seems that using DropTargets on Wx::ListCtrl and Wx::TreeCtrl components
results in incorrect behaviour: although it works at the beginning, repeated
drop on those components always end up in some kind of error, regardless of
DropSource or DropTarget types used.

The errors encountered are of 2 different kinds:
1. When entering/leaving the drop area, an exception occurs. Here, there are
also 2 different scenarios:
1.1. If the DropSource comes from the same application, it results in a
"Segmentation Fault".
1.2. If the DropSource comes from an external application, it results in a
NoMethodError exception on methods on_enter or on_leave for objects
Wx::IdleEvent or Wx::UpdateUIEvent. This happens even if the DropTarget defines
correctly on_enter and on_leave.
2. While dragging over the drop area, the drop is always vetoed (''No
way'' mouse cursor displayed), even if the DropTarget always returns
Wx::DRAG_COPY in on_drag_over method.

The frequency of those errors can vary:
* If the application contains only the faulty component (ListCtrl or TreeCtrl),
droping works several times before getting an error. It is sometimes necessary
to drag/drop 50 or 100 times to get it.
* If the application contains many other components (like in the example below),
the error comes very quickly after dragging over (crossing the component
boundaries) and dropping a few times.

I attach to this report a little test application that can be used to see the
bug. It contains several components on a single frame. Each one of them has a
DropTarget for files, always accepting any file. The first 2 components are
TreeCtrl and ListCtrl. When a file (dragged from your explorer) is dropped on
the components, it should just accept the drop silently. It does not work with
TreeCtrl and ListCtrl.

Here is the test procedure:

1. Run the application attached in this report
2. Drag a file from your explorer on the components to see the normal behaviour.
3. Drag a file on the TreeCtrl or ListCtrl, and see the error (either drop
disabled or exception). If the error does not come first times, try again
several times, dragging over the component''s boundaries several times
before dropping.

The configuration used in my case is:
* Windows XP Pro SP3
* Ruby 1.8.5
* wxruby 2.0.0 (installed using RubyGems)

Please don''t hesitate to tell me if you need any other explanations.

Best regards,

Muriel


----------------------------------------------------------------------

You can respond by visiting: