Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

MesgBox use error

5 views
Skip to first unread message

mor...@niuhep.physics.niu.edu

unread,
Mar 30, 2007, 12:28:06 PM3/30/07
to
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 :)

#!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();
}

Slaven Rezic

unread,
Mar 31, 2007, 3:45:52 PM3/31/07
to
mor...@niuhep.physics.niu.edu writes:

> 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

mor...@physics.niu.edu

unread,
Apr 8, 2007, 2:37:55 PM4/8/07
to
Slaven Rezic wrote:
>morp...@niuhep.physics.niu.edu writes:

>> 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

0 new messages