From: Maxmelbin N. (RBIN/EMT1) <Max...@in...> - 2007-07-06 07:49:18
|
Thanks .. That helped=20 One more question .. How do I retrieve the value form a text field to a variable ? -----Original Message----- From: er...@ki... [mailto:er...@ki...]=20 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)" <Max...@in...>: > Right now I do it like this ... > > $chkb =3D $main->AddTextfield( > -width =3D> 100, > -height =3D> 30, > -left =3D> 100, > -top =3D> 10, > -position =3D> bottom, > -text =3D> $sel3, > ); > > $sel3 =3D "new string"; > Is there a better way ? $chkb->Text($sel3); Working example: use strict; use Win32::GUI (); my $main =3D new Win32::GUI::Window ( -name =3D> "Window", -title =3D> "TekstFieldTest", -pos =3D> [100, 100], -size =3D> [400, 400], ) or die "new Window"; my $chkb =3D $main->AddTextfield( -width =3D> 100, -height =3D> 30, -left =3D> 100, -top =3D> 10, -text =3D> "old", ); my $button=3D $main->AddButton( -text =3D> 'Change', -size =3D> [70,20], -pos =3D> [$main->ScaleWidth()-156,$main->ScaleHeight()-25], -onClick =3D> sub {$chkb->Text("New"); }, ); $main->Show(); Win32::GUI::Dialog(); |
From: Geoffrey S. <geo...@gm...> - 2007-07-06 11:12:43
|
You use the exact same method: my $value = $chkb->Text(); On 7/6/07, Maxmelbin Neson (RBIN/EMT1) <Max...@in...> wrote: > > Thanks .. That helped > > One more question .. > > How do I retrieve the value form a text field to a variable ? > > > > -----Original Message----- > From: er...@ki... [mailto:er...@ki...] > 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)" <Max...@in...>: > > > > 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 > Per...@li... > https://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > http://perl-win32-gui.sourceforge.net/ > -- Geoffrey Spear http://www.geoffreyspear.com/ |