Package: gio

Function gio:icon-to-string

Lambda List

gio:icon-to-string (icon)

Arguments

icon -- a g:icon object

Return Value

The UTF-8 string or nil if icon cannot be serialized.

Details

Generates a textual representation of the icon that can be used for serialization such as when passing the icon to a different process or saving it to persistent storage. Use the g:icon-new-for-string function to get the icon back from the returned string.

The encoding of the returned string is proprietary to a g:icon object except in the following two cases
  • If icon is a g:file-icon object, the returned string is a native path, such as /path/to/my icon.png, without escaping if the g:file object for icon is a native file. If the file is not native, the returned string is the result of the g:file-uri function, such as sftp://path/to/my%20icon.png.
  • If icon is a g:themed-icon object with exactly one name, the encoding is simply the name, such as network-server.
 

See also

2024-10-23