I have a simple window I've created.  Usually, I just do windows with
buttons, but I have a need for text with the window.  I have not found
any examples of how to do this.  Can someone provide an example within
my example of how to just add text to the main portion of the window?
Thank you in advance


Use Win32::GUI;
use Win32 ();

&Win32_GUI();

quit(0);

sub Win32_GUI
{

my $I = new Win32::GUI::Icon('icon.ICO');
my $C = new Win32::GUI::Bitmap("./harrow.cur", 2);
        
my $F = new Win32::GUI::Font(
        -name => "Comic Sans MS",
        -size => 10,
        -bold => 0,
        -underline=>0,
);

# Register a BUTTON class with cursor
my $BC = new Win32::GUI::Class(
        -name => 'Class_Button',            
        -extends => 'BUTTON',               
        -widget => 'Button',                
        -cursor   => $C,                    
);

my $WC = new Win32::GUI::Class(
        -name => '_Button',
        -cursor => $C,
    -icon => $I,
    -color => 2,
);

my $W = new Win32::GUI::Window(
    -title      => "Uptime Monitor",
    -pos        => [100, 100],
    -size       => [400, 400],
    -left       => 300, 
    -top        => 100, 
    -width      => 300, 
    -height     => 600,
    -name       => "Main",
    -class      => $WC,
    -topmost    => 1,
    -font       => $F,
    -sysmenu    => 0,
    -resizable  =>0,   
);

$W->AddButton(
   -text    => "Server List",
   -name    => "GroupBox_1",
   -left    => 2,
   -top     => 40,
   -width   => 290,
   -height  => 530,
   -style  => WS_CHILD | WS_VISIBLE | 7,  # GroupBox
);

$W->AddButton(
    -name    => "Update",
    -left    => 150,
    -top     => 5,
        -text    => "Update",
        -tabstop => 1,
        -class   => $BC,
        #-icon   => $I,
);

$W->AddButton(
    -name    => "Close",
    -left    => 50,
    -top     => 5,
        -text    => "Exit",
        -tabstop => 1,
        -class   => $BC,
        #-icon   => $I,
);

#$W->{-dialogui} = 0;

my ($left, $top, $right, $bottom) = Win32::GUI::GetDesktopWindow();

my $SysTrayICON = new Win32::GUI::Icon('icon.ICO');

my $SysTray = $W->AddNotifyIcon(-name => "SysTray", 
                                          -id => 1, 
                                          -icon => $SysTrayICON, 
                                          -tip => "UPTIME!",
);


$W->Show();

Win32::GUI::Dialog(0);

}

sub Window_Terminate {
    return -1;
}

sub Close_Click {

    Window_Terminate();
}

sub Update_Click {

    
}

__END__


Reply via email to