From: Louis B. <lb...@li...> - 2001-06-26 18:35:56
|
Both yours and someone else's answer was mostly what I was looking for. In= =20 the long run I am trying to create a window with many (at most 10) lines of= =20 words. Each line will contain different text and have a number in=20 it. Ideally I would like the lines to be of different colors. A sub will= =20 run collecting the number to plug in to the lines. At the time I wrote the email I did not see the doevents() which I am=20 looking at now. And no I am just learning this widows programming. Are there any good references on line where I can learn more about this=20 type of programing in perl? Are there more examples any where? Thanks, Louis At 11:20 AM 6/26/2001 -0700, you wrote: >I don't quite see where your problem is ... do you want to know HOW to >update your window or WHEN? >As for the how, your $sb->Text("whatever"); should work fine anytime. As= for >the when, maybe you are looking for a timer so that you can update the >status bar every other second or so. > >No offence, but maybe you just need to grasp the messaging concept of >windows? I mean, when does which part of the script run and pass control >where? That can admittedly be confusing. Forgive me, if that was not what >you wanted to know: > >Your Win32::GUI::Dialog(); call (btw: where IS your Dialog() call??) passes >control to the GUI, which loops for events and calls the event handlers >(e.g. your Button_Click sub) until ANY of these subs returns a negative >number (not just Main_Terminate). A lot of those event handlers do some >default stuff, like redraw all the controls of your window when it becomes >visible. If you have an event handler that runs forever (maybe in a loop of >your own that processes a giant file line by line), then the $sb->Text("20% >done"); call does alter the status bars text property, but the redraw >message, which writes the new text onto the window for you to see never= gets >called, because your program is inside this long running sub and not= passing >control back to the GUI Dialog loop. In that case, simply call >Win32::GUI::DoEvents(); inside your script and the outstanding events will >be acted upon. > >Again, sorry if this is not what you asked for. >Have fun, >Harald > > > -----Original Message----- > > From: Louis Bohm [mailto:lb...@li...] > > Sent: Tuesday, June 26, 2001 10:53 > > To: per...@li... > > Subject: [perl-win32-gui-users] Updating a window. > > > > > > I am sure this is a really stupid question. But how do I > > update things in > > the window I create WITHOUT human intervention. > > > > Here is what I have for a script: > > use Win32::GUI; > > $main =3D Win32::GUI::Window->new( > > -name =3D> 'Main', > > -width =3D> 100, > > -height =3D> 100, > > -text =3D> 'Louis', > > ); > > $main->AddLabel( > > -name =3D> "Louis", > > -text =3D> "Hello World 1" > > ); > > $sb=3D$main->AddStatusBar( > > -name =3D> "Status" > > ); > > $sb->Text("Some data"); > > $main->Show(); > > Win32::GUI::Window(); > > > > sub Main_Terminate { > > -1; > > } > > > > sub Main_Resize { > > $sb->Move(0, $main->ScaleHeight - $sb->Height); > > $sb->Resize($main->ScaleWidth, $sb->Height); > > } > > > > > > Now what I would like to do it periodically update the text > > in the status > > bar with out the user getting involved. > > > > Thanks, > > Louis > > > > -- > > =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`= =B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 > > =A4=B0`=B0Lightbridge, Inc > > =A4=B0`=B067 South Bedford St. > > =A4=B0`=B0Burlington MA 01832 > > =A4=B0`=B0781.359.4795 mailto:lb...@li... > > =A4=B0`=B0http://www.lightbridge.com > > =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`= =B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 > > > > > > _______________________________________________ > > Perl-Win32-GUI-Users mailing list > > Per...@li... > > http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users > > > >_______________________________________________ >Perl-Win32-GUI-Users mailing list >Per...@li... >http://lists.sourceforge.net/lists/listinfo/perl-win32-gui-users -- =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0= =BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 =A4=B0`=B0Lightbridge, Inc =A4=B0`=B067 South Bedford St. =A4=B0`=B0Burlington MA 01832 =A4=B0`=B0781.359.4795 mailto:lb...@li... =A4=B0`=B0http://www.lightbridge.com =A4=A4=BA=B0`=B0=BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0= =BA=A4=F8,=B8=B8,=F8=A4=BA=B0`=B0=BA=A4=F8=F8=A4=BA=B0`=B0=BA=A4 |