Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | None |
Language | Haskell2010 |
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
- newtype DragIcon = DragIcon (ManagedPtr DragIcon)
- class (GObject o, IsDescendantOf DragIcon o) => IsDragIcon o
- toDragIcon :: (MonadIO m, IsDragIcon o) => o -> m DragIcon
- dragIconGetChild :: (HasCallStack, MonadIO m, IsDragIcon a) => a -> m (Maybe Widget)
- dragIconGetForDrag :: (HasCallStack, MonadIO m, IsDrag a) => a -> m Widget
- dragIconSetChild :: (HasCallStack, MonadIO m, IsDragIcon a, IsWidget b) => a -> Maybe b -> m ()
- dragIconSetFromPaintable :: (HasCallStack, MonadIO m, IsDrag a, IsPaintable b) => a -> b -> Int32 -> Int32 -> m ()
- clearDragIconChild :: (MonadIO m, IsDragIcon o) => o -> m ()
- constructDragIconChild :: (IsDragIcon o, MonadIO m, IsWidget a) => a -> m (GValueConstruct o)
- getDragIconChild :: (MonadIO m, IsDragIcon o) => o -> m (Maybe Widget)
- setDragIconChild :: (MonadIO m, IsDragIcon o, IsWidget a) => o -> a -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq DragIcon Source # | |
IsGValue DragIcon Source # | Convert |
ManagedPtrNewtype DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon toManagedPtr :: DragIcon -> ManagedPtr DragIcon # | |
TypedObject DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
GObject DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
HasParentTypes DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
type ParentTypes DragIcon Source # | |
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
(GObject o, IsDescendantOf DragIcon o) => IsDragIcon o Source # | |
Defined in GI.Gtk.Objects.DragIcon |
toDragIcon :: (MonadIO m, IsDragIcon o) => o -> m DragIcon Source #
Methods
Overloaded methods
getChild
:: (HasCallStack, MonadIO m, IsDragIcon a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The drag icon or |
Gets the widget currently used as drag icon.
getForDrag
:: (HasCallStack, MonadIO m, IsDrag a) | |
=> a |
|
-> m Widget | Returns: the |
Gets the DragIcon
in use with drag
.
If no drag icon exists yet, a new one will be created and shown.
setChild
:: (HasCallStack, MonadIO m, IsDragIcon a, IsWidget b) | |
=> a |
|
-> Maybe b | |
-> m () |
Sets the widget to display as the drag icon.
setFromPaintable
dragIconSetFromPaintable Source #
:: (HasCallStack, MonadIO m, IsDrag a, IsPaintable b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> Int32 |
|
-> 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 ]