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();
|