Pregunta

How would I go about cloning any widget from gjs, similar to the C response given in https://stackoverflow.com/a/3030603/1829961? I have not been able to find a way to call list_properties although it is listed in the GModule gir file. Or do I have to use GIRepository, manually walk the GIR type hierarchy, emulating that which g_object_class_list_properties is supposed to do? Or another straight forward way I'm totally missing here?

¿Fue útil?

Solución

Here is some code that will do that.

It takes a similar approach to the quesion you linked, but since there is no G_OBJECT_GET_CLASS() in GJS, it uses GIRepository instead -- which is an extra dependency that you need compared to the C solution.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top