gi-gdk4-4.0.10: Gdk bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gdk.Interfaces.Popup

Contents

- Exported types
- Methods
  - getAutohide
  - getParent
  - getPositionX
  - getPositionY
  - getRectAnchor
  - getSurfaceAnchor
  - present
- Properties
  - autohide
  - parent

Description

A surface that is attached to another surface.

The `GdkPopup` is positioned relative to its parent surface.

`GdkPopup`s are typically used to implement menus and similar popups. They can be modal, which is indicated by the Popup:autohide property.

Synopsis

- newtype Popup = Popup (ManagedPtr Popup)
- class (GObject o, IsDescendantOf Popup o) => IsPopup o
- toPopup :: (MonadIO m, IsPopup o) => o -> m Popup
- popupGetAutohide :: (HasCallStack, MonadIO m, IsPopup a) => a -> m Bool
- popupGetParent :: (HasCallStack, MonadIO m, IsPopup a) => a -> m (Maybe Surface)
- popupGetPositionX :: (HasCallStack, MonadIO m, IsPopup a) => a -> m Int32
- popupGetPositionY :: (HasCallStack, MonadIO m, IsPopup a) => a -> m Int32
- popupGetRectAnchor :: (HasCallStack, MonadIO m, IsPopup a) => a -> m Gravity
- popupGetSurfaceAnchor :: (HasCallStack, MonadIO m, IsPopup a) => a -> m Gravity
- popupPresent :: (HasCallStack, MonadIO m, IsPopup a) => a -> Int32 -> Int32 -> PopupLayout -> m Bool
- constructPopupAutohide :: (IsPopup o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPopupAutohide :: (MonadIO m, IsPopup o) => o -> m Bool
- constructPopupParent :: (IsPopup o, MonadIO m, IsSurface a) => a -> m (GValueConstruct o)
- getPopupParent :: (MonadIO m, IsPopup o) => o -> m (Maybe Surface)

# Exported types

newtype Popup Source #

Memory-managed wrapper type.

Constructors

Popup (ManagedPtr Popup) |

#### Instances

Instances details

Eq Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup Methods (==) :: Popup -> Popup -> Bool Source # (/=) :: Popup -> Popup -> Bool Source #
GObject Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup
ManagedPtrNewtype Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup Methods toManagedPtr :: Popup -> ManagedPtr Popup Source #
TypedObject Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup Methods glibType :: IO GType Source #
HasParentTypes Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup
IsGValue (Maybe Popup) Source # | Convert `Popup` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gdk.Interfaces.Popup Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Popup -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Popup) Source #
type ParentTypes Popup Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup type ParentTypes Popup = '[Object, Surface]

class (GObject o, IsDescendantOf Popup o) => IsPopup o Source #

Type class for types which can be safely cast to `Popup`, for instance with `toPopup`.

#### Instances

Instances details

(GObject o, IsDescendantOf Popup o) => IsPopup o Source # |
Instance details Defined in GI.Gdk.Interfaces.Popup

toPopup :: (MonadIO m, IsPopup o) => o -> m Popup Source #

Cast to `Popup`, 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

beep, bindProperty, bindPropertyFull, createCairoContext, createGlContext, createSimilarSurface, createVulkanContext, destroy, forceFloating, freezeNotify, getv, hide, isDestroyed, isFloating, notify, notifyByPspec, present, queueRender, ref, refSink, requestLayout, runDispose, stealData, stealQdata, thawNotify, translateCoordinates, unref, watchClosure.

#### Getters

getAutohide, getCursor, getData, getDeviceCursor, getDevicePosition, getDisplay, getFrameClock, getHeight, getMapped, getParent, getPositionX, getPositionY, getProperty, getQdata, getRectAnchor, getScale, getScaleFactor, getSurfaceAnchor, getWidth.

#### Setters

setCursor, setData, setDataFull, setDeviceCursor, setInputRegion, setOpaqueRegion, setProperty.

## getAutohide

popupGetAutohide Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m Bool | Returns: `True` if `popup` will autohide

Returns whether this popup is set to hide on outside clicks.

## getParent

popupGetParent Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m (Maybe Surface) | Returns: the parent surface

Returns the parent surface of a popup.

## getPositionX

popupGetPositionX Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m Int32 | Returns: the X coordinate of `popup` position

Obtains the position of the popup relative to its parent.

## getPositionY

popupGetPositionY Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m Int32 | Returns: the Y coordinate of `popup` position

Obtains the position of the popup relative to its parent.

## getRectAnchor

popupGetRectAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m Gravity | Returns: the current rectangle anchor value of `popup`

Gets the current popup rectangle anchor.

The value returned may change after calling `popupPresent`, or after the Surface::layout signal is emitted.

## getSurfaceAnchor

popupGetSurfaceAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: a `GdkPopup`
-> m Gravity | Returns: the current surface anchor value of `popup`

Gets the current popup surface anchor.

The value returned may change after calling `popupPresent`, or after the Surface::layout signal is emitted.

## present

popupPresent Source #

Arguments

:: (HasCallStack, MonadIO m, IsPopup a) |
=> a | `popup`: the `GdkPopup` to show
-> Int32 | `width`: the unconstrained popup width to layout
-> Int32 | `height`: the unconstrained popup height to layout
-> PopupLayout | `layout`: the `GdkPopupLayout` object used to layout
-> m Bool | Returns: `False` if it failed to be presented, otherwise `True`.

Present `popup` after having processed the `GdkPopupLayout` rules.

If the popup was previously not showing, it will be shown, otherwise it will change position according to `layout`.

After calling this function, the result should be handled in response to the Surface::layout signal being emitted. The resulting popup position can be queried using `popupGetPositionX`, `popupGetPositionY`, and the resulting size will be sent as parameters in the layout signal. Use `popupGetRectAnchor` and `popupGetSurfaceAnchor` to get the resulting anchors.

Presenting may fail, for example if the `popup` is set to autohide and is immediately hidden upon being presented. If presenting failed, the Surface::layout signal will not me emitted.

# Properties

## autohide

Whether to hide on outside clicks.

constructPopupAutohide :: (IsPopup o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getPopupAutohide :: (MonadIO m, IsPopup o) => o -> m Bool Source #

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

    get popup #autohide

## parent

The parent surface.

constructPopupParent :: (IsPopup o, MonadIO m, IsSurface a) => a -> m (GValueConstruct o) Source #

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

getPopupParent :: (MonadIO m, IsPopup o) => o -> m (Maybe Surface) Source #

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

    get popup #parent