I have something weird with DnD from and to a TableListBox.
When I select a row, the DragImageComponent appears and I drop it on the same TableListBox to move the row at another index. The row is moved, and everything is fine except that the DragImageComponent does not disappear.
When I select a row and I come to drop it where there is not a DragAndDropTarget, the component disappears then appears again and stay on the Desktop until application is closed.
Apparently, this is due to the timers (ComponentAnimator and DragImageComponent) which are started (startTimer) but whose the callback is not called (timerCallback never called after) and so the animation stay in ComponentAnimator stack and the callback of DragImageComponent does not destroy it.
I am using Windows 7 64bits, the application is compiled in 32bits using Microsoft Visual Studio Express 2012 with v110 (latest) compiler and sources. I have some windows and the main one uses a customized OpenGL component (refreshed only when needed), and the DnD container and target are in another dialog window. Every other components work fine.
I have tried the JuceDemo and there the DnD works perfectly.
So my question is : in this situation, what can cause the fact that timers are not called ?
Can you answer me please because I have removed all components and let only the DnD container/target and the issue persists.
Apparently it is like threads were blocked somewhere but I do not know why !
If you’ve written code that blocks the message thread, no-one else can psychically tell you what you’ve done wrong… That’s for you and your debugger to solve.
But while the DragImageComponent is still shown on Desktop, I can use the message thread (clicking on other buttons, repainting some components and whatever…)
I have done few things to isolate my tree (I had a TableListBox and a TreeView with DnD management)
Actually there are only a juce::DocumentWindow containing a TreeView.
And it is still not working !
Moreover, when I close the main window, I have a jassert in Desktop destructor saying that I have a MouseListener still alive, which is apparently the one used for DnD my item.
I still do not understand how it can be possible.
Ok so I have kind of an answer but it is really weird…
Apparently, this was the static private member of my class which blocked the timers…
The class had a static juce::Image loaded from juce::ImageCache::getFromMemory
Passing it has a non-static member solved the problem.
Jules do you have any idea of why this is happening ?
Sorry, no idea, but it doesn’t sound like you’re correctly interpreting what’s going on there with the static.