Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GtkDragIcon
is a GtkRoot
implementation for drag icons.
A drag icon moves with the pointer during a Drag-and-Drop operation and is destroyed when the drag ends.
To set up a drag icon and associate it with an ongoing drag operation,
use [funcgtk
.DragIcon.get_for_drag] 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
- dragIconCreateWidgetForValue :: (HasCallStack, MonadIO m) => GValue -> m (Maybe Widget)
- 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 # | |
GObject DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
ManagedPtrNewtype DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon toManagedPtr :: DragIcon -> ManagedPtr DragIcon | |
TypedObject DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
HasParentTypes DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon | |
IsGValue (Maybe DragIcon) Source # | Convert |
Defined in GI.Gtk.Objects.DragIcon gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe DragIcon -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe DragIcon) | |
type ParentTypes DragIcon Source # | |
Defined in GI.Gtk.Objects.DragIcon type ParentTypes DragIcon = '[Widget, Object, Accessible, 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
Click to display all available methods, including inherited ones
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocus, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.
createWidgetForValue
dragIconCreateWidgetForValue Source #
:: (HasCallStack, MonadIO m) | |
=> GValue |
|
-> m (Maybe Widget) | Returns: A new |
Creates a widget that can be used as a drag icon for the given
value
.
Supported types include strings, GdkRGBA
and GtkTextBuffer
.
If GTK does not know how to create a widget for a given value,
it will return Nothing
.
This method is used to set the default drag icon on drag-and-drop
operations started by GtkDragSource
, so you don't need to set
a drag icon using this function there.
getChild
:: (HasCallStack, MonadIO m, IsDragIcon a) | |
=> a |
|
-> m (Maybe Widget) | Returns: The drag icon |
Gets the widget currently used as drag icon.
getForDrag
:: (HasCallStack, MonadIO m, IsDrag a) | |
=> a |
|
-> m Widget | Returns: the |
Gets the GtkDragIcon
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 GtkDragIcon
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 ]