i'm not positive about the best way to do this, but
labels can wrap text.  if you just make a big label it
will work.  try this:

use Win32::GUI;

$win = new Win32::GUI::Window(
 -title => 'test',
 -name => 'mywin',
 -left => 100,
 -top => 100,
 -width => 400,
 -height => 400,
);

$lbl = $win->AddLabel(
 -name => 'lbl1',
 -top => 50,
 -left => 10,
 -width => 380,
 -height => 340,
 -text => 'this is the starting text and it is a
really really really really really really really
really really really really really really really
really really long line...'
);

$win->AddButton(
    -name => 'btn1',
    -text => 'click me'
);

$win->Show();
Win32::GUI::Dialog();

sub mywin_Terminate {-1};

sub btn1_Click {
 my $txt = $lbl->Text();
 $txt .= "\nmore label text here";
 $lbl->Text($txt);
}

--- MJG <[EMAIL PROTECTED]> wrote:

> Ok, that's cool, but let's say I want to fill the
> entire window with
> text.  Do I use a label for each row, or is there
> something I can use to
> just fill the window? 
> 
> Thanks
> 
> -----Original Message-----
> From: Ariel Serbin [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, May 07, 2005 1:07 PM
> To: MJG; perl-win32-gui-users@lists.sourceforge.net
> Subject: Re: [perl-win32-gui-users] Simple Text
> 
> To add plain text, you can use a label:
> 
> $W->AddLabel(
>           -name     => "mylabel1",
>           -left     => 10,
>           -top      => 150,
>           -width    => 100,
>           -height   => 22,
>           -text     => "Some Text Here"
>      );
> 
> 
> --- MJG <[EMAIL PROTECTED]> wrote:
> > 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__
> > 
> > 
> > 
> >
>
-------------------------------------------------------
> > This SF.Net email is sponsored by: NEC IT Guy
> Games.
> > Get your fingers limbered up and give it your best
> > shot. 4 great events, 4
> > opportunities to win big! Highest score wins.NEC
> IT
> > Guy Games. Play to
> > win an NEC 61 plasma display. Visit
> > http://www.necitguy.com/?r 
> > _______________________________________________
> > Perl-Win32-GUI-Users mailing list
> > Perl-Win32-GUI-Users@lists.sourceforge.net
> >
>
https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users
> > 
> 
> 


Reply via email to