Re: Why Does Child Window Disappear?
- Posted by cafromsw at yahoo.com Jan 22, 2003
- 409 views
I was just playing around with your code and this seemed to work for me. Does anyone know if it is any better or worse than using doEvents(0) in the loop? REM the openWindow() and setVisible() lines that are right below CWindow4=createEx() REM setVisible( CWindow4, True ) that is in the PushButton3_onClick() routine and right below that line add openWindow(CWindow4, Normal) REM doEvents(0) When I run the code like that it opens the child and diplays the counter. Will that work in your application? Plus you could put code into the CWindow4_onOpen procedure to run whenever the window opened. I do have one question though, why is the variable t in sequence brackets {} in setText when it seems to works fine without them? setText( LText2, sprintf("This is message#%d",{t}) ) setText( LText2, sprintf("This is message#%d",t) ) Chris cafromsw at yahoo.com --- "C. K. Lester" <cklester at yahoo.com> wrote: > > > Windows doesn't like busy-loops like your "pause" > function. You are > > needlessing spinning away doing nothing but > chewing CPU time that could > > be used to draw your window properly. Try using a > timer... > > Look at this code... No "busy-loops." How else would > you program it so that > the child window SHOWS UP and is displayed by > Winblows while the counter > increases? > > ---TEST CODE BEGINS > -- code generated by Win32Lib IDE v0.15.0 > > include Win32lib.ew > without warning > > > Default, 261, 150, 0, 0 ) > constant PushButton3 = createEx( PushButton, > "PushButton3", testWin, 160, > 92, 88, 28, 0, 0 ) > constant CWindow4 = createEx( Window, "CWindow4", > testWin, 12, 8, 204, 76, > or_all({WS_CHILD}), 0 ) > openWindow(CWindow4, Normal) > setVisible( CWindow4, False ) > constant LText2 = createEx( LText, "LText2", > CWindow4, 24, 12, 148, 20, 0, > 0 ) > > > procedure PushButton3_onClick (integer self, integer > event, sequence > params)--params is () > setVisible( CWindow4, True ) > for t=1 to 10000 do > setText( LText2, sprintf("This is message > #%d",{t}) ) > end for > end procedure > setHandler( PushButton3, w32HClick, > routine_id("PushButton3_onClick")) > > WinMain( testWin,Normal ) > > ---TEST CODE ENDS > > > > > TOPICA - Start your own email discussion group. > FREE! > > >