gi-gtk-4.0.4: Gtk bindings
CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
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

GObject DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

ManagedPtrNewtype DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

Methods

toManagedPtr :: DragIcon -> ManagedPtr DragIcon

TypedObject DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

Methods

glibType :: IO GType

HasParentTypes DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

IsGValue (Maybe DragIcon) Source #

Convert DragIcon to and from GValue. See toGValue and fromGValue.

Instance details

Defined in GI.Gtk.Objects.DragIcon

Methods

gvalueGType_ :: IO GType

gvalueSet_ :: Ptr GValue -> Maybe DragIcon -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe DragIcon)

type ParentTypes DragIcon Source # 
Instance details

Defined in GI.Gtk.Objects.DragIcon

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

Click to display all available methods, including inherited ones

Expand

Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, 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 #

Arguments

:: (HasCallStack, MonadIO m) 
=> GValue

value: a Value

-> m (Maybe Widget)

Returns: A new Widget for displaying value as a drag icon.

Creates a widget that can be used as a drag icon for the given value.

Supported types include strings, RGBA and TextBuffer. 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'n'drop operations started by DragSource, so you don't need to set a drag icon using this function there.

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 ]