gi-gtk-3.0.43: Gtk 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.NumerableIcon

Contents

- Exported types
- Methods
  - getBackgroundGicon
  - getBackgroundIconName
  - getCount
  - getLabel
  - getStyleContext
  - new
  - newWithStyleContext
  - setBackgroundGicon
  - setBackgroundIconName
  - setCount
  - setLabel
  - setStyleContext
- Properties
  - backgroundIcon
  - backgroundIconName
  - count
  - label
  - styleContext

Description

GtkNumerableIcon is a subclass of `EmblemedIcon` that can show a number or short string as an emblem. The number can be overlayed on top of another emblem, if desired.

It supports theming by taking font and color information from a provided `StyleContext`; see `numerableIconSetStyleContext`.

Typical numerable icons:

Synopsis

- newtype NumerableIcon = NumerableIcon (ManagedPtr NumerableIcon)
- class (GObject o, IsDescendantOf NumerableIcon o) => IsNumerableIcon o
- toNumerableIcon :: (MonadIO m, IsNumerableIcon o) => o -> m NumerableIcon
- numerableIconGetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Icon)
- numerableIconGetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- numerableIconGetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m Int32
- numerableIconGetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe Text)
- numerableIconGetStyleContext :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> m (Maybe StyleContext)
- numerableIconNew :: (HasCallStack, MonadIO m, IsIcon a) => a -> m Icon
- numerableIconNewWithStyleContext :: (HasCallStack, MonadIO m, IsIcon a, IsStyleContext b) => a -> b -> m Icon
- numerableIconSetBackgroundGicon :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsIcon b) => a -> Maybe b -> m ()
- numerableIconSetBackgroundIconName :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- numerableIconSetCount :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Int32 -> m ()
- numerableIconSetLabel :: (HasCallStack, MonadIO m, IsNumerableIcon a) => a -> Maybe Text -> m ()
- numerableIconSetStyleContext :: (HasCallStack, MonadIO m, IsNumerableIcon a, IsStyleContext b) => a -> b -> m ()
- clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o)
- getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon)
- setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m ()
- clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconBackgroundIconName :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o)
- getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- constructNumerableIconCount :: (IsNumerableIcon o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32
- setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m ()
- clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m ()
- constructNumerableIconLabel :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o)
- getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text)
- setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m ()
- constructNumerableIconStyleContext :: (IsNumerableIcon o, MonadIO m, IsStyleContext a) => a -> m (GValueConstruct o)
- getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext)
- setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m ()

# Exported types

newtype NumerableIcon Source #

Memory-managed wrapper type.

Constructors

NumerableIcon (ManagedPtr NumerableIcon) |

#### Instances

Instances details

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

class (GObject o, IsDescendantOf NumerableIcon o) => IsNumerableIcon o Source #

Type class for types which can be safely cast to `NumerableIcon`, for instance with `toNumerableIcon`.

#### Instances

Instances details

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

toNumerableIcon :: (MonadIO m, IsNumerableIcon o) => o -> m NumerableIcon Source #

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

addEmblem, bindProperty, bindPropertyFull, clearEmblems, equal, forceFloating, freezeNotify, getv, hash, isFloating, notify, notifyByPspec, ref, refSink, runDispose, serialize, stealData, stealQdata, thawNotify, toString, unref, watchClosure.

#### Getters

getBackgroundGicon, getBackgroundIconName, getCount, getData, getEmblems, getIcon, getLabel, getProperty, getQdata, getStyleContext.

#### Setters

setBackgroundGicon, setBackgroundIconName, setCount, setData, setDataFull, setLabel, setProperty, setStyleContext.

## getBackgroundGicon

numerableIconGetBackgroundGicon Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> m (Maybe Icon) | Returns: a `Icon`, or `Nothing`

Deprecated: (Since version 3.14)

Returns the `Icon` that was set as the base background image, or `Nothing` if there’s none. The caller of this function does not own a reference to the returned `Icon`.

Since: 3.0

## getBackgroundIconName

numerableIconGetBackgroundIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> m (Maybe Text) | Returns: an icon name, or `Nothing`

Deprecated: (Since version 3.14)

Returns the icon name used as the base background image, or `Nothing` if there’s none.

Since: 3.0

## getCount

numerableIconGetCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> m Int32 | Returns: the currently displayed value

Deprecated: (Since version 3.14)

Returns the value currently displayed by `self`.

Since: 3.0

## getLabel

numerableIconGetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> m (Maybe Text) | Returns: the currently displayed label

Deprecated: (Since version 3.14)

Returns the currently displayed label of the icon, or `Nothing`.

Since: 3.0

## getStyleContext

numerableIconGetStyleContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> m (Maybe StyleContext) | Returns: a `StyleContext`, or `Nothing`. This object is internal to GTK+ and should not be unreffed. Use `objectRef` if you want to keep it around

Deprecated: (Since version 3.14)

Returns the `StyleContext` used by the icon for theming, or `Nothing` if there’s none.

Since: 3.0

## new

numerableIconNew Source #

Arguments

:: (HasCallStack, MonadIO m, IsIcon a) |
=> a | `baseIcon`: a `Icon` to overlay on
-> m Icon | Returns: a new `Icon`

Deprecated: (Since version 3.14)

Creates a new unthemed `NumerableIcon`.

Since: 3.0

## newWithStyleContext

numerableIconNewWithStyleContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsIcon a, IsStyleContext b) |
=> a | `baseIcon`: a `Icon` to overlay on
-> b | `context`: a `StyleContext`
-> m Icon | Returns: a new `Icon`

Deprecated: (Since version 3.14)

Creates a new `NumerableIcon` which will themed according to the passed `StyleContext`. This is a convenience constructor that calls `numerableIconSetStyleContext` internally.

Since: 3.0

## setBackgroundGicon

numerableIconSetBackgroundGicon Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a, IsIcon b) |
=> a | `self`: a `NumerableIcon`
-> Maybe b | `icon`: a `Icon`, or `Nothing`
-> m () |

Deprecated: (Since version 3.14)

Updates the icon to use `icon` as the base background image. If `icon` is `Nothing`, `self` will go back using style information or default theming for its background image.

If this method is called and an icon name was already set as background for the icon, `icon` will be used, i.e. the last method called between `numerableIconSetBackgroundGicon` and `numerableIconSetBackgroundIconName` has always priority.

Since: 3.0

## setBackgroundIconName

numerableIconSetBackgroundIconName Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> Maybe Text | `iconName`: an icon name, or `Nothing`
-> m () |

Deprecated: (Since version 3.14)

Updates the icon to use the icon named `iconName` from the current icon theme as the base background image. If `iconName` is `Nothing`, `self` will go back using style information or default theming for its background image.

If this method is called and a `Icon` was already set as background for the icon, `iconName` will be used, i.e. the last method called between `numerableIconSetBackgroundIconName` and `numerableIconSetBackgroundGicon` has always priority.

Since: 3.0

## setCount

numerableIconSetCount Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> Int32 | `count`: a number between -99 and 99
-> m () |

Deprecated: (Since version 3.14)

Sets the currently displayed value of `self` to `count`.

The numeric value is always clamped to make it two digits, i.e. between -99 and 99. Setting a count of zero removes the emblem. If this method is called, and a label was already set on the icon, it will automatically be reset to `Nothing` before rendering the number, i.e. the last method called between `numerableIconSetCount` and `numerableIconSetLabel` has always priority.

Since: 3.0

## setLabel

numerableIconSetLabel Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a) |
=> a | `self`: a `NumerableIcon`
-> Maybe Text | `label`: a short label, or `Nothing`
-> m () |

Deprecated: (Since version 3.14)

Sets the currently displayed value of `self` to the string in `label`. Setting an empty label removes the emblem.

Note that this is meant for displaying short labels, such as roman numbers, or single letters. For roman numbers, consider using the Unicode characters U+2160 - U+217F. Strings longer than two characters will likely not be rendered very well.

If this method is called, and a number was already set on the icon, it will automatically be reset to zero before rendering the label, i.e. the last method called between `numerableIconSetLabel` and `numerableIconSetCount` has always priority.

Since: 3.0

## setStyleContext

numerableIconSetStyleContext Source #

Arguments

:: (HasCallStack, MonadIO m, IsNumerableIcon a, IsStyleContext b) |
=> a | `self`: a `NumerableIcon`
-> b | `style`: a `StyleContext`
-> m () |

Deprecated: (Since version 3.14)

Updates the icon to fetch theme information from the given `StyleContext`.

Since: 3.0

# Properties

## backgroundIcon

No description available in the introspection data.

clearNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #

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

    clear #backgroundIcon

constructNumerableIconBackgroundIcon :: (IsNumerableIcon o, MonadIO m, IsIcon a) => a -> m (GValueConstruct o) Source #

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

getNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Icon) Source #

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

    get numerableIcon #backgroundIcon

setNumerableIconBackgroundIcon :: (MonadIO m, IsNumerableIcon o, IsIcon a) => o -> a -> m () Source #

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

    set numerableIcon [ #backgroundIcon := value ]

## backgroundIconName

No description available in the introspection data.

clearNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #

Set the value of the “`background-icon-name`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #backgroundIconName

constructNumerableIconBackgroundIconName :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #

Get the value of the “`background-icon-name`” property. When overloading is enabled, this is equivalent to

    get numerableIcon #backgroundIconName

setNumerableIconBackgroundIconName :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #

Set the value of the “`background-icon-name`” property. When overloading is enabled, this is equivalent to

    set numerableIcon [ #backgroundIconName := value ]

## count

No description available in the introspection data.

constructNumerableIconCount :: (IsNumerableIcon o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

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

getNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> m Int32 Source #

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

    get numerableIcon #count

setNumerableIconCount :: (MonadIO m, IsNumerableIcon o) => o -> Int32 -> m () Source #

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

    set numerableIcon [ #count := value ]

## label

No description available in the introspection data.

clearNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m () Source #

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

    clear #label

constructNumerableIconLabel :: (IsNumerableIcon o, MonadIO m) => Text -> m (GValueConstruct o) Source #

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

getNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe Text) Source #

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

    get numerableIcon #label

setNumerableIconLabel :: (MonadIO m, IsNumerableIcon o) => o -> Text -> m () Source #

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

    set numerableIcon [ #label := value ]

## styleContext

No description available in the introspection data.

constructNumerableIconStyleContext :: (IsNumerableIcon o, MonadIO m, IsStyleContext a) => a -> m (GValueConstruct o) Source #

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

getNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o) => o -> m (Maybe StyleContext) Source #

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

    get numerableIcon #styleContext

setNumerableIconStyleContext :: (MonadIO m, IsNumerableIcon o, IsStyleContext a) => o -> a -> m () Source #

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

    set numerableIcon [ #styleContext := value ]