Search code examples
haskelldrag-and-dropthreepenny-gui

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


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


Solution

  • I got it:

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

    Maybe it helps someone else ;)