Re: Serialization [gtk-list] (was: Re: GTK questions)



Havoc Pennington wrote:

> On Tue, 20 Jul 1999, David Orme wrote:
> >
> > Another (somewhat related) question: is there an easy way to clone a GTK
> > object.  ie: the equivalent of a C++ copy constructor?
> >
>
> Nope, there's no way at all. It might be nice if there were, but...
> You could write your own copy constructors for individual objects of
> course. :-)

I want to create a serialization library (like Java's java.io.serializable or
Python's pickles) for GTK objects.  It seems like the best I can do is to
create my own object inheriting from GtkObject and make everything that
inherits from that serializable.

It seems you'd need:

1) a way to register a GTK type that you see in a data stream even if it
hasn't been used in the app yet.
2) a convention that all serializable objects must use GTK arguments for their
properties.
3) a way to construct a new object given its type name

Does this sound right?

--
David Orme                                       LINUX...
david@coconut-palm-software.com          ...it already goes there
http://www.coconut-palm-software.com               :-)





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]