package Tk::MesgBox; # Documented at the __END__.
# $Id: MesgBox.pm,v 1.12 2000/09/16 14:30:13 mark Exp mark $
When I call MesgBox I get:
Tk::Error: can't make ".mesgbox" its own master at C:/Perl/site/lib/Tk/
Submethods.pm line 37.
at C:/Perl/site/lib/Tk/MesgBox.pm line 62
Tk callback for wm
Tk callback for .frame.button
Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 247
Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 111
<ButtonRelease-1>
(command bound to event)
commenting out line 62:
$win->transient($win->toplevel);
solves the problem and doesn't (as yet) cause any problems.
Below is my code. Am I doing something foolish or is this a problem
with MesgBox?
Or is it a feature? 1/2 :)
#!perl
use Tk 800;
use strict;
use Tk::MesgBox;
my $mw = new MainWindow();
$mw -> geometry('100x100');
my $btnFrm = $mw -> Frame ()
-> pack (-side =>'top');
my $testBtn = $btnFrm -> Button (-text => "Test Button" ,
-command => sub {&testMsg()})
-> pack (-side => 'top');
MainLoop();
#======================================================================
sub testMsg {
my $msgTxt = "You did not choose a valid directory for output";
&popErrMsgBox($msgTxt);
}
#======================================================================
sub popErrMsgBox {
my $msgTxt = $_[0];
my $ErrMsgBx = $mw -> MesgBox( -title => 'Error',
-text => $msgTxt);
$ErrMsgBx -> Show();
}
> Hullo,
> Using ActivePerl downloaded about 3 weeks ago on win XP
> I installed MesgBox.pm using PPM.
>
> package Tk::MesgBox; # Documented at the __END__.
> # $Id: MesgBox.pm,v 1.12 2000/09/16 14:30:13 mark Exp mark $
>
> When I call MesgBox I get:
>
> Tk::Error: can't make ".mesgbox" its own master at C:/Perl/site/lib/Tk/
> Submethods.pm line 37.
> at C:/Perl/site/lib/Tk/MesgBox.pm line 62
> Tk callback for wm
> Tk callback for .frame.button
> Tk::__ANON__ at C:/Perl/site/lib/Tk.pm line 247
> Tk::Button::butUp at C:/Perl/site/lib/Tk/Button.pm line 111
> <ButtonRelease-1>
> (command bound to event)
>
> commenting out line 62:
>
> $win->transient($win->toplevel);
>
> solves the problem and doesn't (as yet) cause any problems.
>
> Below is my code. Am I doing something foolish or is this a problem
> with MesgBox?
> Or is it a feature? 1/2 :)
No. The module is probably not maintained anymore and did not fix in
the transient() call between Tk800 and Tk804. Probably you should use
one of the other message box implementations.
Regards,
Slaven
--
Slaven Rezic - slaven <at> rezic <dot> de
Dump a Tk canvas as an xfig file:
http://search.cpan.org/search?mode=module&query=Tk::CanvasFig
>> I installed MesgBox.pm using PPM.
>> When I call MesgBox I get:
>> Tk::Error: can't make ".mesgbox" its own master at C:/Perl/site/lib/Tk/
>> Below is my code. Am I doing something foolish or is this a problem
>> with MesgBox?
>No. The module is probably not maintained anymore and did not fix in
>the transient() call between Tk800 and Tk804. Probably you should use
>one of the other message box implementations.
Thanks, I ended up using messageBox.
Robert