1.91 <GThemedIcon>

Class: <GThemedIcon>

It derives from <GObject>.

<GThemedIcon> is an implementation of <GIcon> that supports icon themes.

<GThemedIcon> contains a list of all of the icons present in an icon theme, so that icons can be looked up quickly. <GThemedIcon> does not provide actual pixmaps for icons, just the icon names. Ideally something like Gtk.IconTheme.choose_icon should be used to resolve the list of names so that fallback icons work nicely with themes that inherit other themes.

Properties

Property: themed-icon:name self

The icon name.

Its value is a string, or #f.

It can only be set when the object is made, with #:name. It cannot be read.

Property: themed-icon:names self

A #f-terminated array of icon names.

Its value is a vector, each a string (or, to set it, a list), or #f.

It can only be set when the object is made, with #:names.

Property: themed-icon:use-default-fallbacks self

Whether to use the default fallbacks found by shortening the icon name at ’-’ characters. If the "names" array has more than one element, ignores any past the first.

For example, if the icon name was "gnome-dev-cdrom-audio", the array would become


{
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome",
  NULL
};

Its value is a boolean.

It can only be set when the object is made, with #:use-default-fallbacks.

Procedures

Method: themed-icon:append-name self iconname
Method: append-name self iconname

Append a name to the list of icons from within self.

Note that doing so invalidates the hash computed by prior calls to icon:hash.

self

Passed: a <GThemedIcon>.

a <GThemedIcon>

iconname

Passed: a string.

name of icon to append to list of icons from within self.

Method: themed-icon:get-names self ⇒ %return
Method: get-names self ⇒ %return

Gets the names of icons from within self.

self

Passed: a <GThemedIcon>.

a <GThemedIcon>.

%return

Returned: a vector, each a string.

a list of icon names.

Procedure: themed-icon:new iconname ⇒ %return

Creates a new themed icon for iconname.

iconname

Passed: a string.

a string containing an icon name.

%return

Returned: a <GThemedIcon>.

a new <GThemedIcon>.

Procedure: themed-icon:new-from-names iconnames ⇒ %return

Creates a new themed icon for iconnames.

iconnames

Passed: a list or vector, each a string.

an array of strings containing icon names.

%return

Returned: a <GThemedIcon>.

a new <GThemedIcon>

len

Not passed: guile-gi gives the length of iconnames.

the length of the iconnames array, or -1 if iconnames is #f-terminated

Procedure: themed-icon:new-with-default-fallbacks iconname ⇒ %return

Creates a new themed icon for iconname, and all the names that can be created by shortening iconname at ’-’ characters.

In the following example, icon1 and icon2 are equivalent:


const char *names[] = {
  "gnome-dev-cdrom-audio",
  "gnome-dev-cdrom",
  "gnome-dev",
  "gnome"
};

icon1 = g_themed_icon_new_from_names (names, 4);
icon2 = g_themed_icon_new_with_default_fallbacks ("gnome-dev-cdrom-audio");
iconname

Passed: a string.

a string containing an icon name

%return

Returned: a <GThemedIcon>.

a new <GThemedIcon>.

Method: themed-icon:prepend-name self iconname
Method: prepend-name self iconname

Prepend a name to the list of icons from within self.

Note that doing so invalidates the hash computed by prior calls to icon:hash.

self

Passed: a <GThemedIcon>.

a <GThemedIcon>

iconname

Passed: a string.

name of icon to prepend to list of icons from within self.