Weird problem here...  I've been trying to move to Win32::GUI from Tk,
and I can't even get as far as "Hello World" without perl crashing with
a "Perl.exe generated errors and will be closed by Windows" Dr. Watson
popup.

The error I'm getting happens when I try to add pretty much any widget.
For example, right now I'm trying to do something like:

my $text = "Hello World";
$main->AddLabel(-text => $text);

Looking at it with the debugger, it appears that the error occurs as I'm
going through Win32::GUI::WindowProps->FETCH($self, $key), with $key =
"-font".  Going by the tutorials I'm reading, there ought to be a
default value, but perl crashes on FETCH returning Undef.

Even weirder, when I defined a font, it died trying to process $key =
"-handle", which went through just fine before -- it doesn't even get as
far as -font.

The only thing I could think of is maybe it had something to do with the
fact that I had Cygwin's perl on this box as well, so I uninstalled
that, and reinstalled the Win32::GUI module.  Still no dice.

Any ideas?  Am I missing something important here?

--
Eric Hillman
Sr System Administrator
Balogh Becker, LTD.

================
here's the code:
================

use strict;
use Win32::GUI;
use vars qw( $main );


$main = Win32::GUI::Window->new(-name => 'Main', -text => 'Perl',
                                -width => 200, -height => 200);

my $text = "Hello World";
my $textfont = Win32::GUI::Font->new(-name => "Comic Sans MS",
                                     -size => 24);
$main->AddLabel(-text => $text,      # <- If I comment this out,
                -font => $textfont); #    the program works.
$main->Show();
Win32::GUI::Dialog( );


sub Main_Terminate {
    -1;
}

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to