Re: save obj when owner destroyed

From: Dmitry Karasik <dmitry_at_karasik.eu.org>
Date: 11 Aug 2005 18:31:01 +0200
To: prima_at_prima.eu.org

        Hi vytautas!

On 11 Aug 05 at 11:29, "vytautas" (vytautas ) wrote:

 vytautas> Hi How to save object, when his owner is destroyed?

What do you mean by "save"? The object is destroyed indeed when
its owner is destroyed. There is a trick to avoid that though,
but I'm not sure if its meaningfull at all:

use strict;
use Prima qw(Application Buttons);
Prima::Window-> new(
        onClose => sub {
                $_-> owner( $::application) for $_[0]-> widgets
        },
)-> insert( "Prima::Button",
        onClick => sub { exit }
);
run Prima;

/dk
Received on Thu 11 Aug 2005 - 18:31:04 CEST

This archive was generated by hypermail 2.2.0 : Sat 19 Mar 2011 - 18:35:06 CET