Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Adding properties to BoxedType #629

Closed
kornelski opened this issue Apr 14, 2020 · 2 comments
Closed

Adding properties to BoxedType #629

kornelski opened this issue Apr 14, 2020 · 2 comments

Comments

@kornelski
Copy link

glib::subclass shows how to create either an Object with properties, or a BoxedType with no properties.

But is it possible to have BoxedType and have properties on it?

https://gtk-rs.org/docs/glib/subclass/index.html

@sdroege
Copy link
Member

sdroege commented Apr 14, 2020

GObject properties only work for GObjects and not boxed types. Boxed types are only a way to teach GObject (the library, not the type) about "external" types together with the corresponding memory management functions (copy/ref and free/unref).

On your external type you can have whatever API you want, but as it's not a GObject so can't have GObject properties.

Does that answer your question? Do you see some possible improvement in the docs to make this clearer?

@kornelski
Copy link
Author

That helps, thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants