gi-gtk4-4.0.12: Gtk 4.x 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.Gtk.Objects.Picture

Contents

- Exported types
- Methods
  - getAlternativeText
  - getCanShrink
  - getContentFit
  - getFile
  - getIsolateContents
  - getKeepAspectRatio
  - getPaintable
  - new
  - newForFile
  - newForFilename
  - newForPaintable
  - newForPixbuf
  - newForResource
  - setAlternativeText
  - setCanShrink
  - setContentFit
  - setFile
  - setFilename
  - setIsolateContents
  - setKeepAspectRatio
  - setPaintable
  - setPixbuf
  - setResource
- Properties
  - alternativeText
  - canShrink
  - contentFit
  - file
  - isolateContents
  - keepAspectRatio
  - paintable

Description

Displays a `GdkPaintable`.

<picture> <source srcset="picture-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkPicture" src="picture.png"> </picture>

Many convenience functions are provided to make pictures simple to use. For example, if you want to load an image from a file, and then display it, there’s a convenience function to do this:

### c code

    GtkWidget *widget = gtk_picture_new_for_filename ("myfile.png");

If the file isn’t loaded successfully, the picture will contain a “broken image” icon similar to that used in many web browsers. If you want to handle errors in loading the file yourself, for example by displaying an error message, then load the image with and image loading framework such as libglycin, then create the `GtkPicture` with `pictureNewForPaintable`.

Sometimes an application will want to avoid depending on external data files, such as image files. See the documentation of `GResource` for details. In this case, `pictureNewForResource` and `pictureSetResource` should be used.

`GtkPicture` displays an image at its natural size. See `Image` if you want to display a fixed-size image, such as an icon.

## Sizing the paintable

You can influence how the paintable is displayed inside the `GtkPicture` by changing Picture:contentFit. See `ContentFit` for details. Picture:canShrink can be unset to make sure that paintables are never made smaller than their ideal size - but be careful if you do not know the size of the paintable in use (like when displaying user-loaded images). This can easily cause the picture to grow larger than the screen. And Widget:halign and Widget:valign can be used to make sure the paintable doesn't fill all available space but is instead displayed at its original size.

## CSS nodes

`GtkPicture` has a single CSS node with the name `picture`.

## Accessibility

`GtkPicture` uses the `AccessibleRoleImg` role.

Synopsis

- newtype Picture = Picture (ManagedPtr Picture)
- class (GObject o, IsDescendantOf Picture o) => IsPicture o
- toPicture :: (MonadIO m, IsPicture o) => o -> m Picture
- pictureGetAlternativeText :: (HasCallStack, MonadIO m, IsPicture a) => a -> m (Maybe Text)
- pictureGetCanShrink :: (HasCallStack, MonadIO m, IsPicture a) => a -> m Bool
- pictureGetContentFit :: (HasCallStack, MonadIO m, IsPicture a) => a -> m ContentFit
- pictureGetFile :: (HasCallStack, MonadIO m, IsPicture a) => a -> m (Maybe File)
- pictureGetIsolateContents :: (HasCallStack, MonadIO m, IsPicture a) => a -> m Bool
- pictureGetKeepAspectRatio :: (HasCallStack, MonadIO m, IsPicture a) => a -> m Bool
- pictureGetPaintable :: (HasCallStack, MonadIO m, IsPicture a) => a -> m (Maybe Paintable)
- pictureNew :: (HasCallStack, MonadIO m) => m Picture
- pictureNewForFile :: (HasCallStack, MonadIO m, IsFile a) => Maybe a -> m Picture
- pictureNewForFilename :: (HasCallStack, MonadIO m) => Maybe [Char] -> m Picture
- pictureNewForPaintable :: (HasCallStack, MonadIO m, IsPaintable a) => Maybe a -> m Picture
- pictureNewForPixbuf :: (HasCallStack, MonadIO m, IsPixbuf a) => Maybe a -> m Picture
- pictureNewForResource :: (HasCallStack, MonadIO m) => Maybe Text -> m Picture
- pictureSetAlternativeText :: (HasCallStack, MonadIO m, IsPicture a) => a -> Maybe Text -> m ()
- pictureSetCanShrink :: (HasCallStack, MonadIO m, IsPicture a) => a -> Bool -> m ()
- pictureSetContentFit :: (HasCallStack, MonadIO m, IsPicture a) => a -> ContentFit -> m ()
- pictureSetFile :: (HasCallStack, MonadIO m, IsPicture a, IsFile b) => a -> Maybe b -> m ()
- pictureSetFilename :: (HasCallStack, MonadIO m, IsPicture a) => a -> Maybe [Char] -> m ()
- pictureSetIsolateContents :: (HasCallStack, MonadIO m, IsPicture a) => a -> Bool -> m ()
- pictureSetKeepAspectRatio :: (HasCallStack, MonadIO m, IsPicture a) => a -> Bool -> m ()
- pictureSetPaintable :: (HasCallStack, MonadIO m, IsPicture a, IsPaintable b) => a -> Maybe b -> m ()
- pictureSetPixbuf :: (HasCallStack, MonadIO m, IsPicture a, IsPixbuf b) => a -> Maybe b -> m ()
- pictureSetResource :: (HasCallStack, MonadIO m, IsPicture a) => a -> Maybe Text -> m ()
- clearPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> m ()
- constructPictureAlternativeText :: (IsPicture o, MonadIO m) => Text -> m (GValueConstruct o)
- getPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> m (Maybe Text)
- setPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> Text -> m ()
- constructPictureCanShrink :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPictureCanShrink :: (MonadIO m, IsPicture o) => o -> m Bool
- setPictureCanShrink :: (MonadIO m, IsPicture o) => o -> Bool -> m ()
- constructPictureContentFit :: (IsPicture o, MonadIO m) => ContentFit -> m (GValueConstruct o)
- getPictureContentFit :: (MonadIO m, IsPicture o) => o -> m ContentFit
- setPictureContentFit :: (MonadIO m, IsPicture o) => o -> ContentFit -> m ()
- clearPictureFile :: (MonadIO m, IsPicture o) => o -> m ()
- constructPictureFile :: (IsPicture o, MonadIO m, IsFile a) => a -> m (GValueConstruct o)
- getPictureFile :: (MonadIO m, IsPicture o) => o -> m (Maybe File)
- setPictureFile :: (MonadIO m, IsPicture o, IsFile a) => o -> a -> m ()
- constructPictureIsolateContents :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPictureIsolateContents :: (MonadIO m, IsPicture o) => o -> m Bool
- setPictureIsolateContents :: (MonadIO m, IsPicture o) => o -> Bool -> m ()
- constructPictureKeepAspectRatio :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getPictureKeepAspectRatio :: (MonadIO m, IsPicture o) => o -> m Bool
- setPictureKeepAspectRatio :: (MonadIO m, IsPicture o) => o -> Bool -> m ()
- clearPicturePaintable :: (MonadIO m, IsPicture o) => o -> m ()
- constructPicturePaintable :: (IsPicture o, MonadIO m, IsPaintable a) => a -> m (GValueConstruct o)
- getPicturePaintable :: (MonadIO m, IsPicture o) => o -> m (Maybe Paintable)
- setPicturePaintable :: (MonadIO m, IsPicture o, IsPaintable a) => o -> a -> m ()

# Exported types

newtype Picture Source #

Memory-managed wrapper type.

Constructors

Picture (ManagedPtr Picture) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf Picture o) => IsPicture o Source #

Type class for types which can be safely cast to `Picture`, for instance with `toPicture`.

#### Instances

Instances details

(GObject o, IsDescendantOf Picture o) => IsPicture o Source # |
Instance details Defined in GI.Gtk.Objects.Picture

toPicture :: (MonadIO m, IsPicture o) => o -> m Picture Source #

Cast to `Picture`, 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, announce, 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, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAlternativeText, getAncestor, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanShrink, getCanTarget, getChildVisible, getClipboard, getColor, getContentFit, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFile, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getIsolateContents, getKeepAspectRatio, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPaintable, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setAlternativeText, setCanFocus, setCanShrink, setCanTarget, setChildVisible, setContentFit, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFile, setFilename, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setIsolateContents, setKeepAspectRatio, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOverflow, setPaintable, setParent, setPixbuf, setProperty, setReceivesDefault, setResource, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## getAlternativeText

pictureGetAlternativeText Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m (Maybe Text) | Returns: the alternative textual description of `self`.

Gets the alternative textual description of the picture.

The returned string will be `Nothing` if the picture cannot be described textually.

## getCanShrink

pictureGetCanShrink Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m Bool | Returns: `True` if the picture can be made smaller than its contents

Returns whether the `GtkPicture` respects its contents size.

## getContentFit

pictureGetContentFit Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m ContentFit | Returns: the content fit mode

Returns the fit mode for the content of the `GtkPicture`.

See `ContentFit` for details.

Since: 4.8

## getFile

pictureGetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m (Maybe File) | Returns: The `GFile` displayed by `self`.

Gets the `GFile` currently displayed if `self` is displaying a file.

If `self` is not displaying a file, for example when `pictureSetPaintable` was used, then `Nothing` is returned.

## getIsolateContents

pictureGetIsolateContents Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m Bool | Returns: True if contents are isolated

Returns whether the contents are isolated.

Since: 4.22

## getKeepAspectRatio

pictureGetKeepAspectRatio Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m Bool | Returns: `True` if the self tries to keep the contents' aspect ratio

Deprecated: (Since version 4.8)Use `pictureGetContentFit` instead. This willnow return `FALSE` only if Picture:contentFit is`GTK_CONTENT_FIT_FILL`. Returns `TRUE` otherwise.

Returns whether the `GtkPicture` preserves its contents aspect ratio.

## getPaintable

pictureGetPaintable Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> m (Maybe Paintable) | Returns: the displayed paintable

Gets the `GdkPaintable` being displayed by the `GtkPicture`.

## new

pictureNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Picture | Returns: a newly created `GtkPicture` widget.

Creates a new empty `GtkPicture` widget.

## newForFile

pictureNewForFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsFile a) |
=> Maybe a | `file`: a `GFile`
-> m Picture | Returns: a new `GtkPicture`

Creates a new `GtkPicture` displaying the given `file`.

If the file isn’t found or can’t be loaded, the resulting `GtkPicture` is empty.

If you need to detect failures to load the file, use an image loading framework such as libglycin to load the file yourself, then create the `GtkPicture` from the texture.

## newForFilename

pictureNewForFilename Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe [Char] | `filename`: a filename
-> m Picture | Returns: a new `GtkPicture`

Creates a new `GtkPicture` displaying the file `filename`.

This is a utility function that calls `pictureNewForFile`. See that function for details.

## newForPaintable

pictureNewForPaintable Source #

Arguments

:: (HasCallStack, MonadIO m, IsPaintable a) |
=> Maybe a | `paintable`: a `GdkPaintable`
-> m Picture | Returns: a new `GtkPicture`

Creates a new `GtkPicture` displaying `paintable`.

The `GtkPicture` will track changes to the `paintable` and update its size and contents in response to it.

## newForPixbuf

pictureNewForPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsPixbuf a) |
=> Maybe a | `pixbuf`: a `GdkPixbuf`
-> m Picture | Returns: a new `GtkPicture`

Deprecated: (Since version 4.12)Use `pictureNewForPaintable` and`textureNewForPixbuf` instead

Creates a new `GtkPicture` displaying `pixbuf`.

This is a utility function that calls `pictureNewForPaintable`, See that function for details.

The pixbuf must not be modified after passing it to this function.

## newForResource

pictureNewForResource Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> Maybe Text | `resourcePath`: resource path to play back
-> m Picture | Returns: a new `GtkPicture`

Creates a new `GtkPicture` displaying the resource at `resourcePath`.

This is a utility function that calls `pictureNewForFile`. See that function for details.

## setAlternativeText

pictureSetAlternativeText Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Maybe Text | `alternativeText`: a textual description of the contents
-> m () |

Sets an alternative textual description for the picture contents.

It is equivalent to the "alt" attribute for images on websites.

This text will be made available to accessibility tools.

If the picture cannot be described textually, set this property to `Nothing`.

## setCanShrink

pictureSetCanShrink Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Bool | `canShrink`: if `self` can be made smaller than its contents
-> m () |

If set to `True`, then `self` can be made smaller than its contents.

The contents will then be scaled down when rendering.

If you want to still force a minimum size manually, consider using `widgetSetSizeRequest`.

Also of note is that a similar function for growing does not exist because the grow behavior can be controlled via `widgetSetHalign` and `widgetSetValign`.

## setContentFit

pictureSetContentFit Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> ContentFit | `contentFit`: the content fit mode
-> m () |

Sets how the content should be resized to fit the `GtkPicture`.

See `ContentFit` for details.

Since: 4.8

## setFile

pictureSetFile Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a, IsFile b) |
=> a | `self`: a `GtkPicture`
-> Maybe b | `file`: a `GFile`
-> m () |

Makes `self` load and display `file`.

See `pictureNewForFile` for details.

::: warning Note that this function should not be used with untrusted data. Use a proper image loading framework such as libglycin, which can load many image formats into a `GdkTexture`, and then use `imageSetFromPaintable`.

## setFilename

pictureSetFilename Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Maybe [Char] | `filename`: the filename to play
-> m () |

Makes `self` load and display the given `filename`.

This is a utility function that calls `pictureSetFile`.

::: warning Note that this function should not be used with untrusted data. Use a proper image loading framework such as libglycin, which can load many image formats into a `GdkTexture`, and then use `imageSetFromPaintable`.

## setIsolateContents

pictureSetIsolateContents Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Bool | `isolateContents`: if contents are rendered separately
-> m () |

If set to true, then the contents will be rendered individually.

If set to false they will be able to erase or otherwise mix with the background.

GTK supports finer grained isolation, in rare cases where you need this, you can use `snapshotPushIsolation` yourself to achieve this.

By default contents are isolated.

Since: 4.22

## setKeepAspectRatio

pictureSetKeepAspectRatio Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Bool | `keepAspectRatio`: whether to keep aspect ratio
-> m () |

Deprecated: (Since version 4.8)Use `pictureSetContentFit` instead. If stillused, this method will always set the Picture:contentFitproperty to `GTK_CONTENT_FIT_CONTAIN` if `keepAspectRatio` is true,otherwise it will set it to `GTK_CONTENT_FIT_FILL`.

If set to `True`, the `self` will render its contents according to their aspect ratio.

That means that empty space may show up at the top/bottom or left/right of `self`.

If set to `False` or if the contents provide no aspect ratio, the contents will be stretched over the picture's whole area.

## setPaintable

pictureSetPaintable Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a, IsPaintable b) |
=> a | `self`: a `GtkPicture`
-> Maybe b | `paintable`: a `GdkPaintable`
-> m () |

Makes `self` display the given `paintable`.

If `paintable` is `NULL`, nothing will be displayed.

See `pictureNewForPaintable` for details.

## setPixbuf

pictureSetPixbuf Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a, IsPixbuf b) |
=> a | `self`: a `GtkPicture`
-> Maybe b | `pixbuf`: a `GdkPixbuf`
-> m () |

Deprecated: (Since version 4.12)Use `pictureSetPaintable` instead

Sets a `GtkPicture` to show a `GdkPixbuf`.

See `pictureNewForPixbuf` for details.

This is a utility function that calls `pictureSetPaintable`.

## setResource

pictureSetResource Source #

Arguments

:: (HasCallStack, MonadIO m, IsPicture a) |
=> a | `self`: a `GtkPicture`
-> Maybe Text | `resourcePath`: the resource to set
-> m () |

Makes `self` load and display the resource at the given `resourcePath`.

This is a utility function that calls `pictureSetFile`.

# Properties

## alternativeText

The alternative textual description for the picture.

clearPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> m () Source #

Set the value of the “`alternative-text`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #alternativeText

constructPictureAlternativeText :: (IsPicture o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> m (Maybe Text) Source #

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

    get picture #alternativeText

setPictureAlternativeText :: (MonadIO m, IsPicture o) => o -> Text -> m () Source #

Set the value of the “`alternative-text`” property. When overloading is enabled, this is equivalent to

    set picture [ #alternativeText := value ]

## canShrink

If the `GtkPicture` can be made smaller than the natural size of its contents.

constructPictureCanShrink :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getPictureCanShrink :: (MonadIO m, IsPicture o) => o -> m Bool Source #

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

    get picture #canShrink

setPictureCanShrink :: (MonadIO m, IsPicture o) => o -> Bool -> m () Source #

Set the value of the “`can-shrink`” property. When overloading is enabled, this is equivalent to

    set picture [ #canShrink := value ]

## contentFit

How the content should be resized to fit inside the `GtkPicture`.

Since: 4.8

constructPictureContentFit :: (IsPicture o, MonadIO m) => ContentFit -> m (GValueConstruct o) Source #

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

getPictureContentFit :: (MonadIO m, IsPicture o) => o -> m ContentFit Source #

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

    get picture #contentFit

setPictureContentFit :: (MonadIO m, IsPicture o) => o -> ContentFit -> m () Source #

Set the value of the “`content-fit`” property. When overloading is enabled, this is equivalent to

    set picture [ #contentFit := value ]

## file

The `GFile` that is displayed or `Nothing` if none.

clearPictureFile :: (MonadIO m, IsPicture o) => o -> m () Source #

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

    clear #file

constructPictureFile :: (IsPicture o, MonadIO m, IsFile a) => a -> m (GValueConstruct o) Source #

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

getPictureFile :: (MonadIO m, IsPicture o) => o -> m (Maybe File) Source #

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

    get picture #file

setPictureFile :: (MonadIO m, IsPicture o, IsFile a) => o -> a -> m () Source #

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

    set picture [ #file := value ]

## isolateContents

If the rendering of the contents is isolated from the rest of the widget tree.

Since: 4.22

constructPictureIsolateContents :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getPictureIsolateContents :: (MonadIO m, IsPicture o) => o -> m Bool Source #

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

    get picture #isolateContents

setPictureIsolateContents :: (MonadIO m, IsPicture o) => o -> Bool -> m () Source #

Set the value of the “`isolate-contents`” property. When overloading is enabled, this is equivalent to

    set picture [ #isolateContents := value ]

## keepAspectRatio

Whether the GtkPicture will render its contents trying to preserve the aspect ratio.

constructPictureKeepAspectRatio :: (IsPicture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

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

getPictureKeepAspectRatio :: (MonadIO m, IsPicture o) => o -> m Bool Source #

Get the value of the “`keep-aspect-ratio`” property. When overloading is enabled, this is equivalent to

    get picture #keepAspectRatio

setPictureKeepAspectRatio :: (MonadIO m, IsPicture o) => o -> Bool -> m () Source #

Set the value of the “`keep-aspect-ratio`” property. When overloading is enabled, this is equivalent to

    set picture [ #keepAspectRatio := value ]

## paintable

The `GdkPaintable` to be displayed by this `GtkPicture`.

clearPicturePaintable :: (MonadIO m, IsPicture o) => o -> m () Source #

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

    clear #paintable

constructPicturePaintable :: (IsPicture o, MonadIO m, IsPaintable a) => a -> m (GValueConstruct o) Source #

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

getPicturePaintable :: (MonadIO m, IsPicture o) => o -> m (Maybe Paintable) Source #

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

    get picture #paintable

setPicturePaintable :: (MonadIO m, IsPicture o, IsPaintable a) => o -> a -> m () Source #

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

    set picture [ #paintable := value ]