Gio.Icon.new_for_string
function new_for_string(str: String): Gio.Icon {
// Gjs wrapper for g_icon_new_for_string()
}
Generate a Gio.Icon instance from str. This function can fail if str is not valid - see Gio.Icon.prototype.to_string for discussion.
If your application or library provides one or more Gio.Icon implementations you need to ensure that each GLib.Type is registered with the type system prior to calling Gio.icon_new_for_string.
Since 2.20
- str
A string obtained via Gio.Icon.prototype.to_string.
- Returns
An object implementing the Gio.Icon interface or null if @error is set.