Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
- Exported types
- Methods
- clear
- getAnimation
- getGicon
- getIconName
- getIconSet
- getPixbuf
- getPixelSize
- getStock
- getStorageType
- new
- newFromAnimation
- newFromFile
- newFromGicon
- newFromIconName
- newFromIconSet
- newFromPixbuf
- newFromResource
- newFromStock
- newFromSurface
- setFromAnimation
- setFromFile
- setFromGicon
- setFromIconName
- setFromIconSet
- setFromPixbuf
- setFromResource
- setFromStock
- setFromSurface
- setPixelSize
- Properties
The Image
widget displays an image. Various kinds of object
can be displayed as an image; most typically, you would load a
Pixbuf
("pixel buffer") from a file, and then display that.
There’s a convenience function to do this, imageNewFromFile
,
used as follows:
C code
GtkWidget *image; image = gtk_image_new_from_file ("myfile.png");
If the file isn’t loaded successfully, the image 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
pixbufNewFromFile
, then create the Image
with
imageNewFromPixbuf
.
The image file may contain an animation, if so the Image
will
display an animation (tPixbufAnimation
) instead of a static image.
Image
is a subclass of Misc
, which implies that you can
align it (center, left, right) and add padding to it, using
Misc
methods.
Image
is a “no window” widget (has no Window
of its own),
so by default does not receive events. If you want to receive events
on the image, such as button clicks, place the image inside a
EventBox
, then connect to the event signals on the event box.
## Handling button press events on a Image
.
C code
static gboolean button_press_callback (GtkWidget *event_box, GdkEventButton *event, gpointer data) { g_print ("Event box clicked at coordinates %f,%f\n", event->x, event->y); // Returning TRUE means we handled the event, so the signal // emission should be stopped (don’t call any further callbacks // that may be connected). Return FALSE to continue invoking callbacks. return TRUE; } static GtkWidget* create_image (void) { GtkWidget *image; GtkWidget *event_box; image = gtk_image_new_from_file ("myfile.png"); event_box = gtk_event_box_new (); gtk_container_add (GTK_CONTAINER (event_box), image); g_signal_connect (G_OBJECT (event_box), "button_press_event", G_CALLBACK (button_press_callback), image); return image; }
When handling events on the event box, keep in mind that coordinates
in the image may be different from event box coordinates due to
the alignment and padding settings on the image (see Misc
).
The simplest way to solve this is to set the alignment to 0.0
(left/top), and set the padding to zero. Then the origin of
the image will be the same as the origin of the event box.
Sometimes an application will want to avoid depending on external data
files, such as image files. GTK+ comes with a program to avoid this,
called “gdk-pixbuf-csource”. This library
allows you to convert an image into a C variable declaration, which
can then be loaded into a Pixbuf
using
pixbufNewFromInline
.
CSS nodes
GtkImage has a single CSS node with the name image. The style classes may appear on image CSS nodes: .icon-dropshadow, .lowres-icon.
Synopsis
- newtype Image = Image (ManagedPtr Image)
- class (GObject o, IsDescendantOf Image o) => IsImage o
- toImage :: (MonadIO m, IsImage o) => o -> m Image
- imageClear :: (HasCallStack, MonadIO m, IsImage a) => a -> m ()
- imageGetAnimation :: (HasCallStack, MonadIO m, IsImage a) => a -> m (Maybe PixbufAnimation)
- imageGetGicon :: (HasCallStack, MonadIO m, IsImage a) => a -> m (Icon, Int32)
- imageGetIconName :: (HasCallStack, MonadIO m, IsImage a) => a -> m (Text, Int32)
- imageGetIconSet :: (HasCallStack, MonadIO m, IsImage a) => a -> m (IconSet, Int32)
- imageGetPixbuf :: (HasCallStack, MonadIO m, IsImage a) => a -> m (Maybe Pixbuf)
- imageGetPixelSize :: (HasCallStack, MonadIO m, IsImage a) => a -> m Int32
- imageGetStock :: (HasCallStack, MonadIO m, IsImage a) => a -> m (Text, Int32)
- imageGetStorageType :: (HasCallStack, MonadIO m, IsImage a) => a -> m ImageType
- imageNew :: (HasCallStack, MonadIO m) => m Image
- imageNewFromAnimation :: (HasCallStack, MonadIO m, IsPixbufAnimation a) => a -> m Image
- imageNewFromFile :: (HasCallStack, MonadIO m) => [Char] -> m Image
- imageNewFromGicon :: (HasCallStack, MonadIO m, IsIcon a) => a -> Int32 -> m Image
- imageNewFromIconName :: (HasCallStack, MonadIO m) => Maybe Text -> Int32 -> m Image
- imageNewFromIconSet :: (HasCallStack, MonadIO m) => IconSet -> Int32 -> m Image
- imageNewFromPixbuf :: (HasCallStack, MonadIO m, IsPixbuf a) => Maybe a -> m Image
- imageNewFromResource :: (HasCallStack, MonadIO m) => Text -> m Image
- imageNewFromStock :: (HasCallStack, MonadIO m) => Text -> Int32 -> m Image
- imageNewFromSurface :: (HasCallStack, MonadIO m) => Maybe Surface -> m Image
- imageSetFromAnimation :: (HasCallStack, MonadIO m, IsImage a, IsPixbufAnimation b) => a -> b -> m ()
- imageSetFromFile :: (HasCallStack, MonadIO m, IsImage a) => a -> Maybe [Char] -> m ()
- imageSetFromGicon :: (HasCallStack, MonadIO m, IsImage a, IsIcon b) => a -> b -> Int32 -> m ()
- imageSetFromIconName :: (HasCallStack, MonadIO m, IsImage a) => a -> Maybe Text -> Int32 -> m ()
- imageSetFromIconSet :: (HasCallStack, MonadIO m, IsImage a) => a -> IconSet -> Int32 -> m ()
- imageSetFromPixbuf :: (HasCallStack, MonadIO m, IsImage a, IsPixbuf b) => a -> Maybe b -> m ()
- imageSetFromResource :: (HasCallStack, MonadIO m, IsImage a) => a -> Maybe Text -> m ()
- imageSetFromStock :: (HasCallStack, MonadIO m, IsImage a) => a -> Text -> Int32 -> m ()
- imageSetFromSurface :: (HasCallStack, MonadIO m, IsImage a) => a -> Maybe Surface -> m ()
- imageSetPixelSize :: (HasCallStack, MonadIO m, IsImage a) => a -> Int32 -> m ()
- clearImageFile :: (MonadIO m, IsImage o) => o -> m ()
- constructImageFile :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o)
- getImageFile :: (MonadIO m, IsImage o) => o -> m (Maybe Text)
- setImageFile :: (MonadIO m, IsImage o) => o -> Text -> m ()
- clearImageGicon :: (MonadIO m, IsImage o) => o -> m ()
- constructImageGicon :: (IsImage o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o)
- getImageGicon :: (MonadIO m, IsImage o) => o -> m (Maybe Icon)
- setImageGicon :: (MonadIO m, IsImage o, IsIcon a) => o -> a -> m ()
- clearImageIconName :: (MonadIO m, IsImage o) => o -> m ()
- constructImageIconName :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o)
- getImageIconName :: (MonadIO m, IsImage o) => o -> m (Maybe Text)
- setImageIconName :: (MonadIO m, IsImage o) => o -> Text -> m ()
- clearImageIconSet :: (MonadIO m, IsImage o) => o -> m ()
- constructImageIconSet :: (IsImage o, MonadIO m) => IconSet -> m (GValueConstruct o)
- getImageIconSet :: (MonadIO m, IsImage o) => o -> m (Maybe IconSet)
- setImageIconSet :: (MonadIO m, IsImage o) => o -> IconSet -> m ()
- constructImageIconSize :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getImageIconSize :: (MonadIO m, IsImage o) => o -> m Int32
- setImageIconSize :: (MonadIO m, IsImage o) => o -> Int32 -> m ()
- clearImagePixbuf :: (MonadIO m, IsImage o) => o -> m ()
- constructImagePixbuf :: (IsImage o, MonadIO m, IsPixbuf a) => a -> m (GValueConstruct o)
- getImagePixbuf :: (MonadIO m, IsImage o) => o -> m (Maybe Pixbuf)
- setImagePixbuf :: (MonadIO m, IsImage o, IsPixbuf a) => o -> a -> m ()
- clearImagePixbufAnimation :: (MonadIO m, IsImage o) => o -> m ()
- constructImagePixbufAnimation :: (IsImage o, MonadIO m, IsPixbufAnimation a) => a -> m (GValueConstruct o)
- getImagePixbufAnimation :: (MonadIO m, IsImage o) => o -> m (Maybe PixbufAnimation)
- setImagePixbufAnimation :: (MonadIO m, IsImage o, IsPixbufAnimation a) => o -> a -> m ()
- constructImagePixelSize :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getImagePixelSize :: (MonadIO m, IsImage o) => o -> m Int32
- setImagePixelSize :: (MonadIO m, IsImage o) => o -> Int32 -> m ()
- clearImageResource :: (MonadIO m, IsImage o) => o -> m ()
- constructImageResource :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o)
- getImageResource :: (MonadIO m, IsImage o) => o -> m (Maybe Text)
- setImageResource :: (MonadIO m, IsImage o) => o -> Text -> m ()
- clearImageStock :: (MonadIO m, IsImage o) => o -> m ()
- constructImageStock :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o)
- getImageStock :: (MonadIO m, IsImage o) => o -> m (Maybe Text)
- setImageStock :: (MonadIO m, IsImage o) => o -> Text -> m ()
- getImageStorageType :: (MonadIO m, IsImage o) => o -> m ImageType
- clearImageSurface :: (MonadIO m, IsImage o) => o -> m ()
- constructImageSurface :: (IsImage o, MonadIO m) => Surface -> m (GValueConstruct o)
- getImageSurface :: (MonadIO m, IsImage o) => o -> m (Maybe Surface)
- setImageSurface :: (MonadIO m, IsImage o) => o -> Surface -> m ()
- constructImageUseFallback :: (IsImage o, MonadIO m) => Bool -> m (GValueConstruct o)
- getImageUseFallback :: (MonadIO m, IsImage o) => o -> m Bool
- setImageUseFallback :: (MonadIO m, IsImage o) => o -> Bool -> m ()
Exported types
Memory-managed wrapper type.
Instances
Eq Image Source # | |
GObject Image Source # | |
Defined in GI.Gtk.Objects.Image | |
ManagedPtrNewtype Image Source # | |
Defined in GI.Gtk.Objects.Image toManagedPtr :: Image -> ManagedPtr Image | |
TypedObject Image Source # | |
Defined in GI.Gtk.Objects.Image | |
HasParentTypes Image Source # | |
Defined in GI.Gtk.Objects.Image | |
IsGValue (Maybe Image) Source # | Convert |
Defined in GI.Gtk.Objects.Image gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Image -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Image) | |
type ParentTypes Image Source # | |
class (GObject o, IsDescendantOf Image o) => IsImage o Source #
Instances
(GObject o, IsDescendantOf Image o) => IsImage o Source # | |
Defined in GI.Gtk.Objects.Image |
Methods
Click to display all available methods, including inherited ones
Methods
activate, addAccelerator, addChild, addDeviceEvents, addEvents, addMnemonicLabel, addTickCallback, bindProperty, bindPropertyFull, canActivateAccel, childFocus, childNotify, classPath, clear, computeExpand, constructChild, createPangoContext, createPangoLayout, customFinished, customTagEnd, customTagStart, destroy, destroyed, deviceIsShadowed, dragBegin, dragBeginWithCoordinates, dragCheckThreshold, dragDestAddImageTargets, dragDestAddTextTargets, dragDestAddUriTargets, dragDestFindTarget, dragDestGetTargetList, dragDestGetTrackMotion, dragDestSet, dragDestSetProxy, dragDestSetTargetList, dragDestSetTrackMotion, dragDestUnset, dragGetData, dragHighlight, dragSourceAddImageTargets, dragSourceAddTextTargets, dragSourceAddUriTargets, dragSourceGetTargetList, dragSourceSet, dragSourceSetIconGicon, dragSourceSetIconName, dragSourceSetIconPixbuf, dragSourceSetIconStock, dragSourceSetTargetList, dragSourceUnset, dragUnhighlight, draw, ensureStyle, errorBell, event, forceFloating, freezeChildNotify, freezeNotify, getv, grabAdd, grabDefault, grabFocus, grabRemove, hasDefault, hasFocus, hasGrab, hasRcStyle, hasScreen, hasVisibleFocus, hide, hideOnDelete, inDestruction, initTemplate, inputShapeCombineRegion, insertActionGroup, intersect, isAncestor, isComposited, isDrawable, isFloating, isFocus, isSensitive, isToplevel, isVisible, keynavFailed, listAccelClosures, listActionPrefixes, listMnemonicLabels, map, mnemonicActivate, modifyBase, modifyBg, modifyCursor, modifyFg, modifyFont, modifyStyle, modifyText, notify, notifyByPspec, overrideBackgroundColor, overrideColor, overrideCursor, overrideFont, overrideSymbolicColor, parserFinished, path, queueAllocate, queueComputeExpand, queueDraw, queueDrawArea, queueDrawRegion, queueResize, queueResizeNoRedraw, realize, ref, refSink, regionIntersect, registerWindow, removeAccelerator, removeMnemonicLabel, removeTickCallback, renderIcon, renderIconPixbuf, reparent, resetRcStyles, resetStyle, runDispose, sendExpose, sendFocusChange, shapeCombineRegion, show, showAll, showNow, sizeAllocate, sizeAllocateWithBaseline, sizeRequest, stealData, stealQdata, styleAttach, styleGetProperty, thawChildNotify, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unregisterWindow, unsetStateFlags, watchClosure.
Getters
getAccessible, getActionGroup, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedSize, getAllocatedWidth, getAllocation, getAncestor, getAnimation, getAppPaintable, getCanDefault, getCanFocus, getChildRequisition, getChildVisible, getClip, getClipboard, getCompositeName, getData, getDeviceEnabled, getDeviceEvents, getDirection, getDisplay, getDoubleBuffered, getEvents, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getGicon, getHalign, getHasTooltip, getHasWindow, getHexpand, getHexpandSet, getIconName, getIconSet, getInternalChild, getMapped, getMarginBottom, getMarginEnd, getMarginLeft, getMarginRight, getMarginStart, getMarginTop, getModifierMask, getModifierStyle, getName, getNoShowAll, getOpacity, getPadding, getPangoContext, getParent, getParentWindow, getPath, getPixbuf, getPixelSize, getPointer, getPreferredHeight, getPreferredHeightAndBaselineForWidth, getPreferredHeightForWidth, getPreferredSize, getPreferredWidth, getPreferredWidthForHeight, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRequisition, getRootWindow, getScaleFactor, getScreen, getSensitive, getSettings, getSizeRequest, getState, getStateFlags, getStock, getStorageType, getStyle, getStyleContext, getSupportMultidevice, getTemplateChild, getTooltipMarkup, getTooltipText, getTooltipWindow, getToplevel, getValign, getValignWithBaseline, getVexpand, getVexpandSet, getVisible, getVisual, getWindow.
Setters
setAccelPath, setAlignment, setAllocation, setAppPaintable, setBuildableProperty, setCanDefault, setCanFocus, setChildVisible, setClip, setCompositeName, setData, setDataFull, setDeviceEnabled, setDeviceEvents, setDirection, setDoubleBuffered, setEvents, setFocusOnClick, setFontMap, setFontOptions, setFromAnimation, setFromFile, setFromGicon, setFromIconName, setFromIconSet, setFromPixbuf, setFromResource, setFromStock, setFromSurface, setHalign, setHasTooltip, setHasWindow, setHexpand, setHexpandSet, setMapped, setMarginBottom, setMarginEnd, setMarginLeft, setMarginRight, setMarginStart, setMarginTop, setName, setNoShowAll, setOpacity, setPadding, setParent, setParentWindow, setPixelSize, setProperty, setRealized, setReceivesDefault, setRedrawOnAllocate, setSensitive, setSizeRequest, setState, setStateFlags, setStyle, setSupportMultidevice, setTooltipMarkup, setTooltipText, setTooltipWindow, setValign, setVexpand, setVexpandSet, setVisible, setVisual, setWindow.
clear
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m () |
Resets the image to be empty.
Since: 2.8
getAnimation
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m (Maybe PixbufAnimation) | Returns: the displayed animation, or |
Gets the PixbufAnimation
being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypeAnimation
(see imageGetStorageType
).
The caller of this function does not own a reference to the
returned animation.
getGicon
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m (Icon, Int32) |
Gets the Icon
and size being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypeGicon
(see imageGetStorageType
).
The caller of this function does not own a reference to the
returned Icon
.
Since: 2.14
getIconName
Gets the icon name and size being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypeIconName
(see imageGetStorageType
).
The returned string is owned by the Image
and should not
be freed.
Since: 2.6
getIconSet
Deprecated: (Since version 3.10)Use imageGetIconName
instead.
Gets the icon set and size being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypeIconSet
(see imageGetStorageType
).
getPixbuf
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m (Maybe Pixbuf) | Returns: the displayed pixbuf, or |
Gets the Pixbuf
being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypePixbuf
(see imageGetStorageType
).
The caller of this function does not own a reference to the
returned pixbuf.
getPixelSize
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m Int32 | Returns: the pixel size used for named icons. |
Gets the pixel size used for named icons.
Since: 2.6
getStock
Deprecated: (Since version 3.10)Use imageGetIconName
instead.
Gets the stock icon name and size being displayed by the Image
.
The storage type of the image must be ImageTypeEmpty
or
ImageTypeStock
(see imageGetStorageType
).
The returned string is owned by the Image
and should not
be freed.
getStorageType
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> m ImageType | Returns: image representation being used |
Gets the type of representation being used by the Image
to store image data. If the Image
has no image data,
the return value will be ImageTypeEmpty
.
new
:: (HasCallStack, MonadIO m) | |
=> m Image | Returns: a newly created |
Creates a new empty Image
widget.
newFromAnimation
imageNewFromAnimation Source #
:: (HasCallStack, MonadIO m, IsPixbufAnimation a) | |
=> a |
|
-> m Image | Returns: a new |
Creates a Image
displaying the given animation.
The Image
does not assume a reference to the
animation; you still need to unref it if you own references.
Image
will add its own reference rather than adopting yours.
Note that the animation frames are shown using a timeout with
PRIORITY_DEFAULT
. When using animations to indicate busyness,
keep in mind that the animation will only be shown if the main loop
is not busy with something that has a higher priority.
newFromFile
:: (HasCallStack, MonadIO m) | |
=> [Char] |
|
-> m Image | Returns: a new |
Creates a new Image
displaying the file filename
. If the file
isn’t found or can’t be loaded, the resulting Image
will
display a “broken image” icon. This function never returns Nothing
,
it always returns a valid Image
widget.
If the file contains an animation, the image will contain an animation.
If you need to detect failures to load the file, use
pixbufNewFromFile
to load the file yourself, then create
the Image
from the pixbuf. (Or for animations, use
pixbufAnimationNewFromFile
).
The storage type (imageGetStorageType
) of the returned
image is not defined, it will be whatever is appropriate for
displaying the file.
newFromGicon
:: (HasCallStack, MonadIO m, IsIcon a) | |
=> a |
|
-> Int32 |
|
-> m Image | Returns: a new |
Creates a Image
displaying an icon from the current icon theme.
If the icon name isn’t known, a “broken image” icon will be
displayed instead. If the current icon theme is changed, the icon
will be updated appropriately.
Since: 2.14
newFromIconName
:: (HasCallStack, MonadIO m) | |
=> Maybe Text |
|
-> Int32 |
|
-> m Image | Returns: a new |
Creates a Image
displaying an icon from the current icon theme.
If the icon name isn’t known, a “broken image” icon will be
displayed instead. If the current icon theme is changed, the icon
will be updated appropriately.
Since: 2.6
newFromIconSet
:: (HasCallStack, MonadIO m) | |
=> IconSet |
|
-> Int32 |
|
-> m Image | Returns: a new |
Deprecated: (Since version 3.10)Use imageNewFromIconName
instead.
Creates a Image
displaying an icon set. Sample stock sizes are
GTK_ICON_SIZE_MENU
, GTK_ICON_SIZE_SMALL_TOOLBAR
. Instead of using
this function, usually it’s better to create a IconFactory
, put
your icon sets in the icon factory, add the icon factory to the
list of default factories with iconFactoryAddDefault
, and
then use imageNewFromStock
. This will allow themes to
override the icon you ship with your application.
The Image
does not assume a reference to the
icon set; you still need to unref it if you own references.
Image
will add its own reference rather than adopting yours.
newFromPixbuf
:: (HasCallStack, MonadIO m, IsPixbuf a) | |
=> Maybe a | |
-> m Image | Returns: a new |
Creates a new Image
displaying pixbuf
.
The Image
does not assume a reference to the
pixbuf; you still need to unref it if you own references.
Image
will add its own reference rather than adopting yours.
Note that this function just creates an Image
from the pixbuf. The
Image
created will not react to state changes. Should you want that,
you should use imageNewFromIconName
.
newFromResource
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Image | Returns: a new |
Creates a new Image
displaying the resource file resourcePath
. If the file
isn’t found or can’t be loaded, the resulting Image
will
display a “broken image” icon. This function never returns Nothing
,
it always returns a valid Image
widget.
If the file contains an animation, the image will contain an animation.
If you need to detect failures to load the file, use
pixbufNewFromFile
to load the file yourself, then create
the Image
from the pixbuf. (Or for animations, use
pixbufAnimationNewFromFile
).
The storage type (imageGetStorageType
) of the returned
image is not defined, it will be whatever is appropriate for
displaying the file.
Since: 3.4
newFromStock
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> Int32 |
|
-> m Image | Returns: a new |
Deprecated: (Since version 3.10)Use imageNewFromIconName
instead.
Creates a Image
displaying a stock icon. Sample stock icon
names are STOCK_OPEN
, STOCK_QUIT
. Sample stock sizes
are GTK_ICON_SIZE_MENU
, GTK_ICON_SIZE_SMALL_TOOLBAR
. If the stock
icon name isn’t known, the image will be empty.
You can register your own stock icon names, see
iconFactoryAddDefault
and iconFactoryAdd
.
newFromSurface
:: (HasCallStack, MonadIO m) | |
=> Maybe Surface | |
-> m Image | Returns: a new |
setFromAnimation
imageSetFromAnimation Source #
:: (HasCallStack, MonadIO m, IsImage a, IsPixbufAnimation b) | |
=> a |
|
-> b |
|
-> m () |
setFromFile
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Maybe [Char] |
|
-> m () |
See imageNewFromFile
for details.
setFromGicon
:: (HasCallStack, MonadIO m, IsImage a, IsIcon b) | |
=> a |
|
-> b |
|
-> Int32 |
|
-> m () |
See imageNewFromGicon
for details.
Since: 2.14
setFromIconName
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Maybe Text |
|
-> Int32 |
|
-> m () |
See imageNewFromIconName
for details.
Since: 2.6
setFromIconSet
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> IconSet |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 3.10)Use imageSetFromIconName
instead.
See imageNewFromIconSet
for details.
setFromPixbuf
:: (HasCallStack, MonadIO m, IsImage a, IsPixbuf b) | |
=> a |
|
-> Maybe b | |
-> m () |
See imageNewFromPixbuf
for details.
setFromResource
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Maybe Text |
|
-> m () |
See imageNewFromResource
for details.
setFromStock
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Text |
|
-> Int32 |
|
-> m () |
Deprecated: (Since version 3.10)Use imageSetFromIconName
instead.
See imageNewFromStock
for details.
setFromSurface
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Maybe Surface |
|
-> m () |
See imageNewFromSurface
for details.
Since: 3.10
setPixelSize
:: (HasCallStack, MonadIO m, IsImage a) | |
=> a |
|
-> Int32 |
|
-> m () |
Sets the pixel size to use for named icons. If the pixel size is set
to a value != -1, it is used instead of the icon size set by
imageSetFromIconName
.
Since: 2.6
Properties
file
No description available in the introspection data.
clearImageFile :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “file
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#file
constructImageFile :: (IsImage o, MonadIO m) => Text -> 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
.
getImageFile :: (MonadIO m, IsImage o) => o -> m (Maybe Text) Source #
Get the value of the “file
” property.
When overloading is enabled, this is equivalent to
get
image #file
setImageFile :: (MonadIO m, IsImage o) => o -> Text -> m () Source #
Set the value of the “file
” property.
When overloading is enabled, this is equivalent to
set
image [ #file:=
value ]
gicon
The GIcon displayed in the GtkImage. For themed icons, If the icon theme is changed, the image will be updated automatically.
Since: 2.14
clearImageGicon :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “gicon
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#gicon
constructImageGicon :: (IsImage o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “gicon
” property. This is rarely needed directly, but it is used by new
.
getImageGicon :: (MonadIO m, IsImage o) => o -> m (Maybe Icon) Source #
Get the value of the “gicon
” property.
When overloading is enabled, this is equivalent to
get
image #gicon
setImageGicon :: (MonadIO m, IsImage o, IsIcon a) => o -> a -> m () Source #
Set the value of the “gicon
” property.
When overloading is enabled, this is equivalent to
set
image [ #gicon:=
value ]
iconName
The name of the icon in the icon theme. If the icon theme is changed, the image will be updated automatically.
Since: 2.6
clearImageIconName :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “icon-name
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#iconName
constructImageIconName :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “icon-name
” property. This is rarely needed directly, but it is used by new
.
getImageIconName :: (MonadIO m, IsImage o) => o -> m (Maybe Text) Source #
Get the value of the “icon-name
” property.
When overloading is enabled, this is equivalent to
get
image #iconName
setImageIconName :: (MonadIO m, IsImage o) => o -> Text -> m () Source #
Set the value of the “icon-name
” property.
When overloading is enabled, this is equivalent to
set
image [ #iconName:=
value ]
iconSet
No description available in the introspection data.
clearImageIconSet :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “icon-set
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#iconSet
constructImageIconSet :: (IsImage o, MonadIO m) => IconSet -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “icon-set
” property. This is rarely needed directly, but it is used by new
.
getImageIconSet :: (MonadIO m, IsImage o) => o -> m (Maybe IconSet) Source #
Get the value of the “icon-set
” property.
When overloading is enabled, this is equivalent to
get
image #iconSet
setImageIconSet :: (MonadIO m, IsImage o) => o -> IconSet -> m () Source #
Set the value of the “icon-set
” property.
When overloading is enabled, this is equivalent to
set
image [ #iconSet:=
value ]
iconSize
No description available in the introspection data.
constructImageIconSize :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “icon-size
” property. This is rarely needed directly, but it is used by new
.
getImageIconSize :: (MonadIO m, IsImage o) => o -> m Int32 Source #
Get the value of the “icon-size
” property.
When overloading is enabled, this is equivalent to
get
image #iconSize
setImageIconSize :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #
Set the value of the “icon-size
” property.
When overloading is enabled, this is equivalent to
set
image [ #iconSize:=
value ]
pixbuf
No description available in the introspection data.
clearImagePixbuf :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “pixbuf
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#pixbuf
constructImagePixbuf :: (IsImage o, MonadIO m, IsPixbuf a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “pixbuf
” property. This is rarely needed directly, but it is used by new
.
getImagePixbuf :: (MonadIO m, IsImage o) => o -> m (Maybe Pixbuf) Source #
Get the value of the “pixbuf
” property.
When overloading is enabled, this is equivalent to
get
image #pixbuf
setImagePixbuf :: (MonadIO m, IsImage o, IsPixbuf a) => o -> a -> m () Source #
Set the value of the “pixbuf
” property.
When overloading is enabled, this is equivalent to
set
image [ #pixbuf:=
value ]
pixbufAnimation
No description available in the introspection data.
clearImagePixbufAnimation :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “pixbuf-animation
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#pixbufAnimation
constructImagePixbufAnimation :: (IsImage o, MonadIO m, IsPixbufAnimation a) => a -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “pixbuf-animation
” property. This is rarely needed directly, but it is used by new
.
getImagePixbufAnimation :: (MonadIO m, IsImage o) => o -> m (Maybe PixbufAnimation) Source #
Get the value of the “pixbuf-animation
” property.
When overloading is enabled, this is equivalent to
get
image #pixbufAnimation
setImagePixbufAnimation :: (MonadIO m, IsImage o, IsPixbufAnimation a) => o -> a -> m () Source #
Set the value of the “pixbuf-animation
” property.
When overloading is enabled, this is equivalent to
set
image [ #pixbufAnimation:=
value ]
pixelSize
The "pixel-size" property can be used to specify a fixed size
overriding the Image
:icon-size
property for images of type
ImageTypeIconName
.
Since: 2.6
constructImagePixelSize :: (IsImage o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “pixel-size
” property. This is rarely needed directly, but it is used by new
.
getImagePixelSize :: (MonadIO m, IsImage o) => o -> m Int32 Source #
Get the value of the “pixel-size
” property.
When overloading is enabled, this is equivalent to
get
image #pixelSize
setImagePixelSize :: (MonadIO m, IsImage o) => o -> Int32 -> m () Source #
Set the value of the “pixel-size
” property.
When overloading is enabled, this is equivalent to
set
image [ #pixelSize:=
value ]
resource
A path to a resource file to display.
Since: 3.8
clearImageResource :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “resource
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#resource
constructImageResource :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “resource
” property. This is rarely needed directly, but it is used by new
.
getImageResource :: (MonadIO m, IsImage o) => o -> m (Maybe Text) Source #
Get the value of the “resource
” property.
When overloading is enabled, this is equivalent to
get
image #resource
setImageResource :: (MonadIO m, IsImage o) => o -> Text -> m () Source #
Set the value of the “resource
” property.
When overloading is enabled, this is equivalent to
set
image [ #resource:=
value ]
stock
No description available in the introspection data.
clearImageStock :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “stock
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#stock
constructImageStock :: (IsImage o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “stock
” property. This is rarely needed directly, but it is used by new
.
getImageStock :: (MonadIO m, IsImage o) => o -> m (Maybe Text) Source #
Get the value of the “stock
” property.
When overloading is enabled, this is equivalent to
get
image #stock
setImageStock :: (MonadIO m, IsImage o) => o -> Text -> m () Source #
Set the value of the “stock
” property.
When overloading is enabled, this is equivalent to
set
image [ #stock:=
value ]
storageType
No description available in the introspection data.
getImageStorageType :: (MonadIO m, IsImage o) => o -> m ImageType Source #
Get the value of the “storage-type
” property.
When overloading is enabled, this is equivalent to
get
image #storageType
surface
No description available in the introspection data.
clearImageSurface :: (MonadIO m, IsImage o) => o -> m () Source #
Set the value of the “surface
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#surface
constructImageSurface :: (IsImage o, MonadIO m) => Surface -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “surface
” property. This is rarely needed directly, but it is used by new
.
getImageSurface :: (MonadIO m, IsImage o) => o -> m (Maybe Surface) Source #
Get the value of the “surface
” property.
When overloading is enabled, this is equivalent to
get
image #surface
setImageSurface :: (MonadIO m, IsImage o) => o -> Surface -> m () Source #
Set the value of the “surface
” property.
When overloading is enabled, this is equivalent to
set
image [ #surface:=
value ]
useFallback
Whether the icon displayed in the GtkImage will use
standard icon names fallback. The value of this property
is only relevant for images of type ImageTypeIconName
and ImageTypeGicon
.
Since: 3.0
constructImageUseFallback :: (IsImage o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “use-fallback
” property. This is rarely needed directly, but it is used by new
.
getImageUseFallback :: (MonadIO m, IsImage o) => o -> m Bool Source #
Get the value of the “use-fallback
” property.
When overloading is enabled, this is equivalent to
get
image #useFallback
setImageUseFallback :: (MonadIO m, IsImage o) => o -> Bool -> m () Source #
Set the value of the “use-fallback
” property.
When overloading is enabled, this is equivalent to
set
image [ #useFallback:=
value ]