Package: gobject
Function g-value-transform
Lambda Listg-value-transform (src-value dest-value) ArgumentsReturn ValueWhether a transformation rule was found and could be applied. Upon failing transformations, dest-value is left untouched. Details Tries to cast the contents of src-value into a type appropriate to store in dest-value, e.g. to transform a "gint" value into a
"gfloat" value.
Performing transformations between value types might incur precision
lossage. Especially transformations into strings might reveal seemingly
arbitrary results and should not be relied upon for production code. Example;; A transformation from an integer to a string (defcallback int2string :void ((src-value (:pointer (:struct g-value))) (dest-value (:pointer (:struct g-value)))) (if (= (g-value-int src-value) 42) (setf (g-value-string dest-value) "An important number") (setf (g-value-string dest-value) "What is that?"))) | See also |
2021-4-8