--- On Thu, 5/7/09, [email protected] <[email protected]> 
wrote:

> From: [email protected] <[email protected]>
> Subject: Re: Re: Glib::Object and Storable
> To: [email protected]
> Date: Thursday, May 7, 2009, 11:09 PM
> On May 7, 2009 2:21pm, Dave Howorth
> <[email protected]> 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.


      
_______________________________________________
gtk-perl-list mailing list
[email protected]
http://mail.gnome.org/mailman/listinfo/gtk-perl-list

Reply via email to