From: Waldemar B. <wb...@sa...> - 2007-12-05 06:46:38
|
Thank you Brian, it works! Waldemar Wednesday 05 of December 2007 02:34:50 napisa=B3e=B6(-=B3a=B6): > Waldemar Biernacki wrote: > > Hello! > > > > At the end I've enclosed the little code of Perl/Win32:GUI. > > > > If you start the code you can notice that the sequence=20 > > is the following: > > > > 1. Window appears on the screen. > > 2. An incomplete "field1" appears too. > > 3. After 2 seconds it disappears!!! for next 2 seconds and > > the field "field2" is displayed also incomplete. > > 4. At the end both fields are displayed correctly.=20 > > > > Could anyone of you predict this disappearance looking at the code? > > If yes please let me know how to get the following sequence=20 > > of events: > > > > 1. The first complete "field1" is displayed at the beginning. > > 2. After two seconds the second field is also displayed, > > but still the first is visible. > > > > And additional question: is this behavior (unlogical for me) > > the feature of Perl Win32::GUI or native Win32-GUI itself? > > > > Regards > > Waldemar > > =20 >=20 > I'm not sure what you are trying to do here, but if you want field1 to=20 > show for 2 seconds, and then field2 to appear, here is the corrected=20 > script. (There may be a better way to do this, but it's what I could=20 > think of off the top of my head.) >=20 > ################################# > #!/usr/bin/perl -w >=20 > use warnings; > use strict; >=20 > use Win32::GUI qw(); >=20 > my $my_window =3D new Win32::GUI::Window ( > -name =3D> 'my_window', > -size =3D> [ 400, 400 ], > ); > $my_window->Show(1); >=20 > my $field1 =3D $my_window->AddTextfield( > -name =3D> 'field1', > -text =3D> 'field1', > -pos =3D> [ 30, 30 ], > -size =3D> [ 100, 100 ], > ); >=20 > $field1->SetFocus(); > $my_window->DoEvents(); # You need to DoEvents to see what you added to=20 > the window > sleep(2); >=20 > my $field2 =3D $my_window->AddTextfield( > -name =3D> 'field2', > -text =3D> 'field2', > -pos =3D> [ 130, 130 ], > -size =3D> [ 100, 100 ], > ); >=20 > $field2->SetFocus(); > $my_window->DoEvents(); # Update the window > sleep(2); >=20 > Win32::GUI::Dialog(); >=20 > ################################# >=20 |