monomer-1.4.0.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 HaskellNone
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 :: (DragMsg a, WidgetEvent e) => (a -> e) -> WidgetNode s e -> WidgetNode s e Source #

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

dropTarget_ :: (DragMsg a, WidgetEvent e) => (a -> e) -> [DropTargetCfg] -> WidgetNode s e -> WidgetNode s e Source #

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