Re: example from Mastering Perl/Tk (correction)
by Michael van Nieuwenhuize other posts by this author
May 8 2003 6:16PM messages near this date
Re: example from Mastering Perl/Tk (correction)
|
Re: example from Mastering Perl/Tk
Tim,
I sent you the wrong info.
Try this instead:
$tl = $mw-> Toplevel()
Mike
At 09:45 AM 5/8/2003 -0700, Tim Harsch wrote:
> Hi all,
>
> I typed in this example, as far as I can tell, exactly as it appears in the
> CH11, p.233 of the book.
>
> use Tk;
>
> $mw = MainWindow->new();
> $mw->title("MainWindow");
> $mw->Button( -text => "TopLevel", -command => \&do_TopLevel )->pack();
>
> MainLoop;
> sub do_TopLevel {
> if( ! Exists($tl) ) {
> $tl = $mw->TopLevel();
> $tl->title("TopLevel");
> $tl->Button( -text => "Close",
> -command => sub { $tl->withdraw })->pack();
> } else {
> $tl->deiconify();
> $tl->raise();
> } # end if
> } # end sub
>
>
> I get errors I don't understand when I try to run it:
> Tk::Error: Can't locate auto/Tk/TopLevel.al in @INC (@INC contains:
> C:\Program Files\ActiveState Komodo 2.3 C:/Perl/lib C:/Perl/site/lib .) at
> C:\Documents and Settings\Tim Harsch.BBRP2000\My Documents\Book
> Code\mastperltk_examples\mptk-code14\ch11\TopLevel.pl line 11
> Carp::croak at C:/Perl/lib/Carp.pm line 119
> AutoLoader::AUTOLOAD at C:/Perl/lib/AutoLoader.pm line 104
> main::do_TopLevel at C:\Documents and Settings\Tim Harsch.BBRP2000\My
> Documents\Book Code\mastperltk_examples\mptk-code14\ch11\TopLevel.pl line 11
> [\&main::do_TopLevel]
> Tk callback for .button
> Tk::__ANON__[C:/Perl/site/lib/Tk.pm:228] at C:/Perl/site/lib/Tk.pm line 228
> Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 113
> (command bound to event)
>
>
> Help.
>
> -++**==--++**==--++**==--++**==--++**==--++**==--++**==
> This message was posted through the Stanford campus mailing list
> server. If you wish to unsubscribe from this mailing list, send the
> message body of "unsubscribe ptk" to majordomo@[...].edu
Michael van Nieuwenhuize
Phone: (858) 651-7413
Pager: (858) 636-9438 or
michaelv@[...].com
email : michaelv@[...].com
Office: BB-122E
-++**==--++**==--++**==--++**==--++**==--++**==--++**==
This message was posted through the Stanford campus mailing list
server. If you wish to unsubscribe from this mailing list, send the
message body of "unsubscribe ptk" to majordomo@lists.stanford.edu
|