Re: Re: Glib::Object and Storable






--- On Thu, 5/7/09, jeffrey ratcliffe gmail com <jeffrey ratcliffe gmail com> wrote:

From: jeffrey ratcliffe gmail com <jeffrey ratcliffe gmail com>
Subject: Re: Re: Glib::Object and Storable
To: gtk-perl-list gnome org
Date: Thursday, May 7, 2009, 11:09 PM
On May 7, 2009 2:21pm, Dave Howorth
<dhoworth mrc-lmb cam ac uk> wrote:

Emmanuele Bassi wrote:
unless you can
override the deserialization sequence in order to create
an underlying C instance first, otherwise no.

Thanks for confirming that.


http://search.cpan.org/~ams/Storable-2.18/Storable.pm#Hooks>
 ??

Maybe that would be possible, but not at my
level of knowledge. Thanks for pointing it out.

Regards

Jeff
-----Inline Attachment Follows-----


When I needed to store the state of my GUI, I wrote a routines which upon encountering widgets converted them 
into their properties, for example:

      if(
        $src_ref =~ m/^Gtk2\:\:VScale\=/
     or $src_ref =~ m/^Gtk2\:\:HScale\=/
        )
        {
        $dst_ref = $src_ref->get_value;
        }
      elsif($src_ref =~ m/^Gtk2\:\:ToggleButton\=/)
        {
        $dst_ref = $src_ref->get_active;
        }
      else
        {
        $dst_ref = $src_ref;
        }
.

So, rather than storing (useless in this case) references I stored the
properties from which the widgets could be reconstituted.

Of course, I have a reverse, i.e. a routine which reconstitutes widgets
from their properties.

I am doing all this not as hooks, but as independent routines, and call
Data::Dumper "as is".

Regards,
  Sergei.


      



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