Serialize GtkWidget

Hi, I’d like to know if there is any tool or function to serialize any GtkWidget and export in a file. I need the serialization of main features of a widget like the size, position, color, etc …

Short answer: No

Longer answer: You could serialise a snapshot of it (gsk_render_node_serialize), but that only gives you its appearance — not ‘size’ or ‘position’ — and probably isn’t what you want.

Then again I’ve really no idea what your trying to do here, so you could be wanting anything :slight_smile:

In a model-view architecture, usually the widgets represent the view. What you probably want is to put all the features that need to be serialized into a separate model and then bind that to some widgets.

Yes, maybe the name of the topic is not right but I need to export the features of the widget in order to use in other tool.

Well, I need to export the features of a widget to use in a different tool. I searched for information about it and found none. That is the reason why I’m doing on my own, but I wanted to know if there was another alternative

Is this tool called “Voldemort”, that you can’t name it?

You cannot really serialise a random GtkWidget: at most you can peek at the properties of a GObject instance, but those property might not be serialisable themselves, or they may not map to “features” of a widget instance.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.