https://kotlinlang.org logo
#compose-desktop
Title
# compose-desktop
h

Hamba

11/24/2023, 7:41 AM
Is there a way to access the awt component of any composable (im not sure if this question even makes sense tbh)? im implementing drag and dropping files onto my app, and right now im setting window.dropTarget, which triggers an even when dragging things onto anywhere in the window, but i only want to it work when dragging onto a specific panel. is it possible to get the specific component and set its droptarget?
a

Alexander Maryanovsky

11/24/2023, 8:27 AM
The entire compose app is drawn on the window itself.
There’s not an awt component underlying every compose element.
h

Hamba

11/24/2023, 8:32 AM
right, then is there a way to achieve what i want?
a

Alexander Maryanovsky

11/24/2023, 8:56 AM
Have you seen
Modifier.onExternalDrag
?
h

Hamba

11/24/2023, 9:31 AM
i couldve sworn i tried that and it wasnt being recognised as a valid method of modifier but thats definitely the way to go, thanks
i had the same issue to solve. sadly no really out of the box solutions available
h

Hamba

11/24/2023, 9:54 AM
no the modifier.onExternalDrag works
@Zoff
image.png,image.png
you only get the file paths but with that you can do whatever you want
6 Views