Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Win32::GUI crashes perl?

by ibanix (Hermit)
on Dec 01, 2002 at 18:16 UTC ( #216788=perlquestion: print w/ replies, xml ) Need Help??
ibanix has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellow monks,

I've been trying to use Win32::GUI (0.558) on my Win2k/ActivePerl 633 system to create windows. So far, I've been taking code straight from the tutorial.

use Win32::GUI; $main = Win32::GUI::Window->new( -name => 'Main', -width => 100, -height => 100, ); $main->AddLabel(-text => "Hello, world"); $main->Show(); Win32::GUI::Dialog(); sub Main_Terminate { -1; }
When I run this script, Windows informs me that perl.exe has "generated errors and will be closed by windows". If I reduce the code to
use Win32::GUI; $main = Win32::GUI::Window->new( -name => 'Main', -width => 100, -height => 100, ); $main->Show();
it "works" (generates a window which vanishes instantly). As soon as I add  $main->AddLabel(-text => "Hello, world");
, however, the error returns.

Can any wise monks help me here?

<-> In general, we find that those who disparage a given operating system, language, or philosophy have never had to use it in practice. <->

Comment on Win32::GUI crashes perl?
Select or Download Code
Re: Win32::GUI crashes perl?
by jjdraco (Scribe) on Dec 01, 2002 at 22:40 UTC
    Since I'm on Linux I don't think it would do any good for me to try
    and run this script, but have you tried adding use strict;
    and use warnings; to see if they give you any more
    messages that might help find the problem.

    jjdraco
    learning Perl one statement at a time.
Re: Win32::GUI crashes perl?
by dree (Monsignor) on Dec 01, 2002 at 22:42 UTC
    You have to put a
    -name=>"something"
    in the "widgets", e.g.
    $main->AddLabel(-text => "Hello, world", -name => "hello_label" );
    It's a bug introduced in the 0.0.558 and fixed in the 0.0.665
      Thanks! This is exactly what I needed to know!

      <-> In general, we find that those who disparage a given operating system, language, or philosophy have never had to use it in practice. <->

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://216788]
Approved by mr2
Front-paged by tye
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (17)
As of 2015-07-02 17:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (44 votes), past polls