gi-gtk-4.0.2: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.DragIcon

Description

GtkDragIcon is a Root implementation with the sole purpose to serve as a drag icon during DND operations. A drag icon moves with the pointer during a drag operation and is destroyed when the drag ends.

To set up a drag icon and associate it with an ongoing drag operation, use dragIconGetForDrag to get the icon for a drag. You can then use it like any other widget and use dragIconSetChild to set whatever widget should be used for the drag icon.

Keep in mind that drag icons do not allow user input.

Synopsis

Exported types

newtype DragIcon Source #

Memory-managed wrapper type.

Constructors

DragIcon (ManagedPtr DragIcon) 

Instances

Instances details
Eq DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

IsGValue DragIcon Source #

Convert DragIcon to and from GValue with toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.DragIcon

ManagedPtrNewtype DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

TypedObject DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

Methods

glibType :: IO GType #

GObject DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

HasParentTypes DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

type ParentTypes DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

type ParentTypes DragIcon = '[Widget, Object, ImplementorIface, Buildable, ConstraintTarget, Native, Root]

class (GObject o, IsDescendantOf DragIcon o) => IsDragIcon o Source #

Type class for types which can be safely cast to DragIcon, for instance with toDragIcon.

Instances

Instances details
(GObject o, IsDescendantOf DragIcon o) => IsDragIcon o Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

toDragIcon :: (MonadIO m, IsDragIcon o) => o -> m DragIcon Source #

Cast to DragIcon, for types for which this is known to be safe. For general casts, use castTo.

Methods

Overloaded methods

getChild

dragIconGetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragIcon a) 
=> a

self: a DragIcon

-> m (Maybe Widget)

Returns: The drag icon or Nothing if none.

Gets the widget currently used as drag icon.

getForDrag

dragIconGetForDrag Source #

Arguments

:: (HasCallStack, MonadIO m, IsDrag a) 
=> a

drag: a Drag

-> m Widget

Returns: the DragIcon

Gets the DragIcon in use with drag.

If no drag icon exists yet, a new one will be created and shown.

setChild

dragIconSetChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsDragIcon a, IsWidget b) 
=> a

self: a DragIcon

-> Maybe b

child: a Widget or Nothing

-> m () 

Sets the widget to display as the drag icon.

setFromPaintable

dragIconSetFromPaintable Source #

Arguments

:: (HasCallStack, MonadIO m, IsDrag a, IsPaintable b) 
=> a

drag: a Drag

-> b

paintable: a Paintable to display

-> Int32

hotX: X coordinate of the hotspot

-> Int32

hotY: Y coordinate of the hotspot

-> m () 

Creates a DragIcon that shows paintable, and associates it with the drag operation. The hotspot position on the paintable is aligned with the hotspot of the cursor.

Properties

child

The widget to display as drag icon.

clearDragIconChild :: (MonadIO m, IsDragIcon o) => o -> m () Source #

Set the value of the “child” property to Nothing. When overloading is enabled, this is equivalent to

clear #child

constructDragIconChild :: (IsDragIcon o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o) Source #

Construct a GValueConstruct with valid value for the “child” property. This is rarely needed directly, but it is used by new.

getDragIconChild :: (MonadIO m, IsDragIcon o) => o -> m (Maybe Widget) Source #

Get the value of the “child” property. When overloading is enabled, this is equivalent to

get dragIcon #child

setDragIconChild :: (MonadIO m, IsDragIcon o, IsWidget a) => o -> a -> m () Source #

Set the value of the “child” property. When overloading is enabled, this is equivalent to

set dragIcon [ #child := value ]