g_icon_new_for_string (
  const gchar* str,
  GError** error


Generate a GIcon instance from str. This function can fail if str is not valid - see g_icon_to_string() for discussion.

If your application or library provides one or more GIcon implementations you need to ensure that each GType is registered with the type system prior to calling g_icon_new_for_string().

Available since:2.20


str const gchar*

A string obtained via g_icon_to_string().

 The data is owned by the caller of the function.
 The value is a NUL terminated UTF-8 string.
error GError **
  The return location for a GError*, or NULL.

Return value

Returns: GIcon

An object implementing the GIcon interface or NULL if error is set.

 The caller of the function takes ownership of the data, and is responsible for freeing it.