Hello,

I'm just getting started with Win32::GUI. I have a basic question. I create
a window, but can't get a Label to show up. Is there another way to put text
in the window?

Can you spot what I'm doing wrong? Code is below:

#perl
use Win32::GUI;

$screen_width  = Win32::GUI::GetSystemMetrics(0);
$screen_height = Win32::GUI::GetSystemMetrics(1);

$M_width  = 200,
$M_height = 100,
$M = new Win32::GUI::Window(
          -name     => "MainWindow",
          -left     => ($screen_width - $M_width) / 2,
          -top      => ($screen_height - $M_height) / 2,
          -width    => $M_width,
          -height       => $M_height,
          -text     => "Title",
          -style    => WS_BORDER | WS_CAPTION,
);
$M->AddLabel(
        -name           => "lblOne",
        -left           => 10,
        -top            => 20,
        -width          => 190,
        -height         => 22,
        -text           => "Label",
                -foreground     => [0,0,0]
);
$M->Show;
#$M->lblOne->Show; #doesn't work
#$M->InvalidateRect(1); #no luck
#$M->lblOne->InvalidateRect(1); #Also doesn't work
sleep(5);

--
Mark Thomas
[EMAIL PROTECTED]

Reply via email to