monomer-1.5.1.0: A GUI library for writing native Haskell applications.
Copyright(c) 2018 Francisco Vallarino
LicenseBSD-3-Clause (see the LICENSE file)
Maintainerfjvallarino@gmail.com
Stabilityexperimental
Portabilitynon-portable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Monomer.Widgets.Containers.DropTarget

Description

Drop target container for a single element. Useful for adding drag support without having to implement a custom widget. Usually works in tandem with Monomer.Widgets.Containers.Draggable.

Raises a user provided event when an item is dropped. The type must match with the type of the dragged widget message, otherwise it will not be raised.

target = dropTarget ItemDropped $
  vstack itemsRows
    `styleBasic` [width 200, height 400]

See Tutorial 6 (Composite) for a usage example.

Synopsis

Configuration

data DropTargetCfg Source #

Configuration options for dropTarget:

  • dropTargetStyle: The style to apply to the container when a dragged item is on top.

dropTargetStyle :: [StyleState] -> DropTargetCfg Source #

The style to apply to the container when a dragged item is on top.

Constructors

dropTarget Source #

Arguments

:: (DragMsg a, WidgetEvent e) 
=> (a -> e)

The event to raise on drop.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created drop target container.

Creates a drop target container with a single node as child.

dropTarget_ Source #

Arguments

:: (DragMsg a, WidgetEvent e) 
=> (a -> e)

The event to raise on drop.

-> [DropTargetCfg]

The config options.

-> WidgetNode s e

The child node.

-> WidgetNode s e

The created drop target container.

Creates a drop target container with a single node as child. Accepts config.