CtkNumerableIcon

CtkNumerableIcon — A GIcon that allows numbered emblems

Functions

Properties

GIcon * background-icon Read / Write
char * background-icon-name Read / Write
int count Read / Write
char * label Read / Write
CtkStyleContext * style-context Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GEmblemedIcon
        ╰── CtkNumerableIcon

Implemented Interfaces

CtkNumerableIcon implements GIcon.

Includes

#include <ctk/ctk.h>

Description

CtkNumerableIcon is a subclass of GEmblemedIcon 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 CtkStyleContext; see ctk_numerable_icon_set_style_context().

Typical numerable icons:

Functions

ctk_numerable_icon_new ()

GIcon *
ctk_numerable_icon_new (GIcon *base_icon);

ctk_numerable_icon_new has been deprecated since version 3.14 and should not be used in newly-written code.

Creates a new unthemed CtkNumerableIcon.

Parameters

base_icon

a GIcon to overlay on

 

Returns

a new GIcon.

[transfer full]

Since: 3.0


ctk_numerable_icon_new_with_style_context ()

GIcon *
ctk_numerable_icon_new_with_style_context
                               (GIcon *base_icon,
                                CtkStyleContext *context);

ctk_numerable_icon_new_with_style_context has been deprecated since version 3.14 and should not be used in newly-written code.

Creates a new CtkNumerableIcon which will themed according to the passed CtkStyleContext. This is a convenience constructor that calls ctk_numerable_icon_set_style_context() internally.

Parameters

base_icon

a GIcon to overlay on

 

context

a CtkStyleContext

 

Returns

a new GIcon.

[transfer full]

Since: 3.0


ctk_numerable_icon_get_background_gicon ()

GIcon *
ctk_numerable_icon_get_background_gicon
                               (CtkNumerableIcon *self);

ctk_numerable_icon_get_background_gicon has been deprecated since version 3.14 and should not be used in newly-written code.

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

Parameters

self

a CtkNumerableIcon

 

Returns

a GIcon, or NULL.

[nullable][transfer none]

Since: 3.0


ctk_numerable_icon_set_background_gicon ()

void
ctk_numerable_icon_set_background_gicon
                               (CtkNumerableIcon *self,
                                GIcon *icon);

ctk_numerable_icon_set_background_gicon has been deprecated since version 3.14 and should not be used in newly-written code.

Updates the icon to use icon as the base background image. If icon is NULL, 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 ctk_numerable_icon_set_background_gicon() and ctk_numerable_icon_set_background_icon_name() has always priority.

Parameters

self

a CtkNumerableIcon

 

icon

a GIcon, or NULL.

[allow-none]

Since: 3.0


ctk_numerable_icon_get_background_icon_name ()

const gchar *
ctk_numerable_icon_get_background_icon_name
                               (CtkNumerableIcon *self);

ctk_numerable_icon_get_background_icon_name has been deprecated since version 3.14 and should not be used in newly-written code.

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

Parameters

self

a CtkNumerableIcon

 

Returns

an icon name, or NULL.

[nullable]

Since: 3.0


ctk_numerable_icon_set_background_icon_name ()

void
ctk_numerable_icon_set_background_icon_name
                               (CtkNumerableIcon *self,
                                const gchar *icon_name);

ctk_numerable_icon_set_background_icon_name has been deprecated since version 3.14 and should not be used in newly-written code.

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

If this method is called and a GIcon was already set as background for the icon, icon_name will be used, i.e. the last method called between ctk_numerable_icon_set_background_icon_name() and ctk_numerable_icon_set_background_gicon() has always priority.

Parameters

self

a CtkNumerableIcon

 

icon_name

an icon name, or NULL.

[allow-none]

Since: 3.0


ctk_numerable_icon_get_count ()

gint
ctk_numerable_icon_get_count (CtkNumerableIcon *self);

ctk_numerable_icon_get_count has been deprecated since version 3.14 and should not be used in newly-written code.

Returns the value currently displayed by self .

Parameters

self

a CtkNumerableIcon

 

Returns

the currently displayed value

Since: 3.0


ctk_numerable_icon_set_count ()

void
ctk_numerable_icon_set_count (CtkNumerableIcon *self,
                              gint count);

ctk_numerable_icon_set_count has been deprecated since version 3.14 and should not be used in newly-written code.

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 NULL before rendering the number, i.e. the last method called between ctk_numerable_icon_set_count() and ctk_numerable_icon_set_label() has always priority.

Parameters

self

a CtkNumerableIcon

 

count

a number between -99 and 99

 

Since: 3.0


ctk_numerable_icon_get_label ()

const gchar *
ctk_numerable_icon_get_label (CtkNumerableIcon *self);

ctk_numerable_icon_get_label has been deprecated since version 3.14 and should not be used in newly-written code.

Returns the currently displayed label of the icon, or NULL.

Parameters

self

a CtkNumerableIcon

 

Returns

the currently displayed label.

[nullable]

Since: 3.0


ctk_numerable_icon_set_label ()

void
ctk_numerable_icon_set_label (CtkNumerableIcon *self,
                              const gchar *label);

ctk_numerable_icon_set_label has been deprecated since version 3.14 and should not be used in newly-written code.

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 ctk_numerable_icon_set_label() and ctk_numerable_icon_set_count() has always priority.

Parameters

self

a CtkNumerableIcon

 

label

a short label, or NULL.

[allow-none]

Since: 3.0


ctk_numerable_icon_get_style_context ()

CtkStyleContext *
ctk_numerable_icon_get_style_context (CtkNumerableIcon *self);

ctk_numerable_icon_get_style_context has been deprecated since version 3.14 and should not be used in newly-written code.

Returns the CtkStyleContext used by the icon for theming, or NULL if there’s none.

Parameters

self

a CtkNumerableIcon

 

Returns

a CtkStyleContext, or NULL. This object is internal to CTK+ and should not be unreffed. Use g_object_ref() if you want to keep it around.

[nullable][transfer none]

Since: 3.0


ctk_numerable_icon_set_style_context ()

void
ctk_numerable_icon_set_style_context (CtkNumerableIcon *self,
                                      CtkStyleContext *style);

ctk_numerable_icon_set_style_context has been deprecated since version 3.14 and should not be used in newly-written code.

Updates the icon to fetch theme information from the given CtkStyleContext.

Parameters

self

a CtkNumerableIcon

 

style

a CtkStyleContext

 

Since: 3.0

Types and Values

struct CtkNumerableIcon

struct CtkNumerableIcon;

Property Details

The “background-icon” property

  “background-icon”          GIcon *

The icon for the number emblem background.

Owner: CtkNumerableIcon

Flags: Read / Write


The “background-icon-name” property

  “background-icon-name”     char *

The icon name for the number emblem background.

Owner: CtkNumerableIcon

Flags: Read / Write

Default value: NULL


The “count” property

  “count”                    int

The count of the emblem currently displayed.

Owner: CtkNumerableIcon

Flags: Read / Write

Allowed values: [-99,99]

Default value: 0


The “label” property

  “label”                    char *

The label to be displayed over the icon.

Owner: CtkNumerableIcon

Flags: Read / Write

Default value: NULL


The “style-context” property

  “style-context”            CtkStyleContext *

The style context to theme the icon appearance.

Owner: CtkNumerableIcon

Flags: Read / Write