package YourPackage; use strict;use warnings; use Tk; use Tk::Canvas; sub new { my $class = shift; my $self = bless {}, $class; my $mw = MainWindow->new(); $self->{'mainwin'}=$mw; $self->{'mycanvas'}=$mw->Canvas(); return $self; } sub getcanvas { my $self=shift; printf "Returning a %s\n",ref($self->{'mycanvas'}); return $self->{'mycanvas'} } package main; my $YP = YourPackage->new(); my $canvas=$YP->getcanvas();
In reply to Re^5: Question about embedded Tk::Canvas
by kschwab
in thread Question about embedded Tk::Canvas
by emilbarton
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |