I used JUCE 5.2.0 I just created an area to drag and drop file there, I wrote a class inheritance from FileDragAndDropTarget. I run the app and dropped file there but function isInterestedInFileDrag wasn’t called? Does anyone help me why it was?
It’s hard to say without seeing any of your code but make sure that one of the Components in the parent hierarchy of your
FileDragAndDropTarget derives from
Thank you for your reply.
Here is my code link
I used JUCE 5.2.0.
I dont know why the function isInterestedInFileDrag() wasn’t called when i drag a file.
Maybe it was a copy/paste error when you put it into the google doc, but I don’t think it compiled.
The paint method is missing the
g as argument. The compiler would have complained, when you called
g.fillAll (...) in paint.
Also it is not required, but you should add the keyword
override after paint() and resized().
Can you double check, if it is actually running that code and not an outdated build without the FileDragAndDropTarget?
Sorry for my copy mistakes. Please help me view this code link
I’ve built and run this code.
Hi @daniel, is there any error with my code?
I can run it but the function isInterestedInFileDrag() wasn’t called. !
I’ve just run your code and
isInterestedInFileDrag() is being called when I drag a file over the Component. What platform is this on? Can you also try running your app with the latest tip of develop.
Thank @ed95, I’ve run the run code but isInterestedInFileDrag() wasn’t called. Did you run code with JUCE 5.2.0?
Yes. What platform are you on?
I run on Windows 10
OK I’ve just tried it on Windows 10 and it works fine, I’m really not sure what else to suggest here. Have you actually put a breakpoint in
isInterestedInFileDrag() to see if it gets called when you hover a file over the window?