You use the exact same method: my $value = $chkb->Text();
On 7/6/07, Maxmelbin Neson (RBIN/EMT1) <[EMAIL PROTECTED]> wrote:
Thanks .. That helped One more question .. How do I retrieve the value form a text field to a variable ? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Friday, 6. July 2007 12:19 PM To: Maxmelbin Neson (RBIN/EMT1) Subject: Re: [perl-win32-gui-users] How do I replace the text in atextfield in Win32::GUI /textfield Quoting "Maxmelbin Neson (RBIN/EMT1)" <[EMAIL PROTECTED]>: > Right now I do it like this ... > > $chkb = $main->AddTextfield( > -width => 100, > -height => 30, > -left => 100, > -top => 10, > -position => bottom, > -text => $sel3, > ); > > $sel3 = "new string"; > Is there a better way ? $chkb->Text($sel3); Working example: use strict; use Win32::GUI (); my $main = new Win32::GUI::Window ( -name => "Window", -title => "TekstFieldTest", -pos => [100, 100], -size => [400, 400], ) or die "new Window"; my $chkb = $main->AddTextfield( -width => 100, -height => 30, -left => 100, -top => 10, -text => "old", ); my $button= $main->AddButton( -text => 'Change', -size => [70,20], -pos => [$main->ScaleWidth()-156,$main->ScaleHeight()-25], -onClick => sub {$chkb->Text("New"); }, ); $main->Show(); Win32::GUI::Dialog(); ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Perl-Win32-GUI-Users mailing list Perl-Win32-GUI-Users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users http://perl-win32-gui.sourceforge.net/
-- Geoffrey Spear http://www.geoffreyspear.com/