Threepenny-GUI: Drag'n'Drop - Access DragData

80 views Asked by At

I am currently struggling with getting access to the DragData of the dragged element when the on UI.drop is called. I have something like this:

tile <- UI.new
    # set UI.draggable True
    # set UI.dragData (show player)

field <- UI.new
    # set UI.droppable True

on UI.drop field $ \_ -> do
    -- How to receive the DragData here?

Can somebody help me? Thanks in advance!

Greetings, Moritz

1

There are 1 answers

0
m0.o On BEST ANSWER

I got it:

on UI.drop field $ \dragData -> do
    d <- read dragData

Maybe it helps someone else ;)