I have tried it, but still sg. is out of the pic.
I have modified the code, see http://pastebin.com/YfMpZ4Cd
I still can not see my $obj in Onclick...
Frame shows up fine, but in Onclick $self is an empty hash -
MyFrame=HASH(xxxxxx)

On Sun, Oct 24, 2010 at 2:01 PM, Johan Vromans <jvrom...@squirrel.nl> wrote:

> Laslo Forro <getfo...@gmail.com> writes:
>
> > http://pastebin.com/RDYzgwhs
>
> As I see it your problem is that OnInit initialises the frame, and you
> cannot pass a parameter to OnInit.
>
> The solution is easy: don't use OnInit...
>
> sub new {
>        my $ref=shift;
>        my $obj=shift;
>        my $self=$ref->SUPER::new();  # SUPER::new() calls OnInit
>        my $frame = MyFrame->new($self,  $obj);
>        $frame->Show( 1 );
>        return $self;
> }
>
> sub OnInit { 1 }        # you must have one and it must return true
>
> HTH,
>
> -- Johan
>

Reply via email to