Generate a Icon instance from str
.
This function can fail if str
is not valid - see to_string for
discussion.
If your application or library provides one or more Icon implementations you need to ensure that each Type is registered with the type system prior to calling new_for_string.
str |
A string obtained via to_string. |
An object implementing the Icon interface or null if throws is set. |