Class: Gio::ThemedIcon

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#append_name(iconname) ⇒ nil

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

Note that doing so invalidates the hash computed by prior calls to g_icon_hash().

Parameters:

  • iconname (String)

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

Returns:

  • (nil)

#name=(name) ⇒ String

The icon name.

Parameters:

  • name (String)

Returns:

  • (String)

    name

#namesGio::

A nil-terminated array of icon names.

Returns:

#names=(names) ⇒ Gio::

A nil-terminated array of icon names.

Parameters:

Returns:

#new(iconname) ⇒ Gio::ThemedIcon

Creates a new themed icon for iconname.

Parameters:

  • iconname (String)

    a string containing an icon name.

Returns:

#new_from_names(iconnames, len) ⇒ Gio::ThemedIcon

Creates a new themed icon for iconnames.

Parameters:

  • iconnames (Array<String>)

    an array of strings containing icon names.

  • len (Integer)

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

Returns:

#new_with_default_fallbacks(iconname) ⇒ Gio::ThemedIcon

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");

Parameters:

  • iconname (String)

    a string containing an icon name

Returns:

#prepend_name(iconname) ⇒ nil

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

Note that doing so invalidates the hash computed by prior calls to g_icon_hash().

Parameters:

  • iconname (String)

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

Returns:

  • (nil)

#use_default_fallbacks=(use_default_fallbacks) ⇒ TrueClass

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
};

Parameters:

  • use_default_fallbacks (TrueClass)

Returns:

  • (TrueClass)

    use-default-fallbacks

  • (TrueClass)

    use-default-fallbacks

#use_default_fallbacks?TrueClass

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
};

Returns:

  • (TrueClass)

    use-default-fallbacks