What was missing, was a bug I my code. This works now, commented. Thanx a lot. http://pastebin.com/UKRAmDxw
On Sun, Oct 24, 2010 at 3:10 PM, Laslo Forro <[email protected]> wrote: > 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 <[email protected]>wrote: > >> Laslo Forro <[email protected]> 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 >> > >
