Gtk.NumerableIcon¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | Gio.EmblemedIcon (5), GObject.Object (37), Gio.Icon (6) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| class | new(base_icon) | 
| class | new_with_style_context(base_icon, context) | 
| get_background_gicon() | |
| get_background_icon_name() | |
| get_count() | |
| get_label() | |
| get_style_context() | |
| set_background_gicon(icon) | |
| set_background_icon_name(icon_name) | |
| set_count(count) | |
| set_label(label) | |
| set_style_context(style) | 
Virtual Methods¶
| Inherited: | GObject.Object (7), Gio.Icon (3) | 
|---|
Properties¶
| Inherited: | Gio.EmblemedIcon (1) | 
|---|
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| background-icon | Gio.Icon | r/w | The icon for the number emblem background | 
| background-icon-name | str | r/w | The icon name for the number emblem background | 
| count | int | r/w | The count of the emblem currently displayed | 
| label | str | r/w | The label to be displayed over the icon | 
| style-context | Gtk.StyleContext | r/w | The style context to theme the icon appearance | 
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gtk.NumerableIcon(**kwargs)¶
- Bases: - Gio.EmblemedIcon- Abstract: - No - Structure: - Gtk.NumerableIconClass- Gtk.NumerableIconis a subclass of- Gio.EmblemedIconthat 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 - Gtk.StyleContext; see- Gtk.NumerableIcon.set_style_context().- Typical numerable icons: - 
classmethod new(base_icon)[source]¶
- Parameters: - base_icon ( - Gio.Icon) – a- Gio.Iconto overlay on- Returns: - a new - Gio.Icon- Return type: - Gio.Icon- Creates a new unthemed - Gtk.NumerableIcon.- New in version 3.0. - Deprecated since version 3.14. 
 - 
classmethod new_with_style_context(base_icon, context)[source]¶
- Parameters: - base_icon (Gio.Icon) – aGio.Iconto overlay on
- context (Gtk.StyleContext) – aGtk.StyleContext
 - Returns: - a new - Gio.Icon- Return type: - Creates a new - Gtk.NumerableIconwhich will themed according to the passed- Gtk.StyleContext. This is a convenience constructor that calls- Gtk.NumerableIcon.set_style_context() internally.- New in version 3.0. - Deprecated since version 3.14. 
- base_icon (
 - 
get_background_gicon()[source]¶
- Returns: - a - Gio.Icon, or- None- Return type: - Gio.Iconor- None- Returns the - Gio.Iconthat was set as the base background image, or- Noneif there’s none. The caller of this function does not own a reference to the returned- Gio.Icon.- New in version 3.0. - Deprecated since version 3.14. 
 - 
get_background_icon_name()[source]¶
- Returns: - an icon name, or - None- Return type: - stror- None- Returns the icon name used as the base background image, or - Noneif there’s none.- New in version 3.0. - Deprecated since version 3.14. 
 - 
get_count()[source]¶
- Returns: - the currently displayed value - Return type: - int- Returns the value currently displayed by self. - New in version 3.0. - Deprecated since version 3.14. 
 - 
get_label()[source]¶
- Returns: - the currently displayed label - Return type: - stror- None- Returns the currently displayed label of the icon, or - None.- New in version 3.0. - Deprecated since version 3.14. 
 - 
get_style_context()[source]¶
- Returns: - a - Gtk.StyleContext, or- None. This object is internal to GTK+ and should not be unreffed. Use- GObject.Object.ref() if you want to keep it around- Return type: - Gtk.StyleContextor- None- Returns the - Gtk.StyleContextused by the icon for theming, or- Noneif there’s none.- New in version 3.0. - Deprecated since version 3.14. 
 - 
set_background_gicon(icon)[source]¶
- Parameters: - icon ( - Gio.Iconor- None) – a- Gio.Icon, or- None- Updates the icon to use icon as the base background image. If icon is - None, 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 - Gtk.NumerableIcon.set_background_gicon() and- Gtk.NumerableIcon.set_background_icon_name() has always priority.- New in version 3.0. - Deprecated since version 3.14. 
 - 
set_background_icon_name(icon_name)[source]¶
- Parameters: - icon_name ( - stror- None) – an icon name, or- None- Updates the icon to use the icon named icon_name from the current icon theme as the base background image. If icon_name is - None, self will go back using style information or default theming for its background image.- If this method is called and a - Gio.Iconwas already set as background for the icon, icon_name will be used, i.e. the last method called between- Gtk.NumerableIcon.set_background_icon_name() and- Gtk.NumerableIcon.set_background_gicon() has always priority.- New in version 3.0. - Deprecated since version 3.14. 
 - 
set_count(count)[source]¶
- Parameters: - count ( - int) – a number between -99 and 99- 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 - Nonebefore rendering the number, i.e. the last method called between- Gtk.NumerableIcon.set_count() and- Gtk.NumerableIcon.set_label() has always priority.- New in version 3.0. - Deprecated since version 3.14. 
 - 
set_label(label)[source]¶
- Parameters: - label ( - stror- None) – a short label, or- None- 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 - Gtk.NumerableIcon.set_label() and- Gtk.NumerableIcon.set_count() has always priority.- New in version 3.0. - Deprecated since version 3.14. 
 - 
set_style_context(style)[source]¶
- Parameters: - style ( - Gtk.StyleContext) – a- Gtk.StyleContext- Updates the icon to fetch theme information from the given - Gtk.StyleContext.- New in version 3.0. - Deprecated since version 3.14. 
 
- 
classmethod 
Property Details¶
- 
Gtk.NumerableIcon.props.background_icon¶
- Name: - background-icon- Type: - Gio.Icon- Default Value: - None- Flags: - READABLE,- WRITABLE- The icon for the number emblem background 
- 
Gtk.NumerableIcon.props.background_icon_name¶
- Name: - background-icon-name- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- The icon name for the number emblem background 
- 
Gtk.NumerableIcon.props.count¶
- Name: - count- Type: - int- Default Value: - 0- Flags: - READABLE,- WRITABLE- The count of the emblem currently displayed 
- 
Gtk.NumerableIcon.props.label¶
- Name: - label- Type: - str- Default Value: - None- Flags: - READABLE,- WRITABLE- The label to be displayed over the icon 
- 
Gtk.NumerableIcon.props.style_context¶
- Name: - style-context- Type: - Gtk.StyleContext- Default Value: - None- Flags: - READABLE,- WRITABLE- The style context to theme the icon appearance