Re: Why the Stoppage?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Because "MatrixLife()" runs after "WinMain()" and that doesn't return until you
close the window.

Windows programming is NOT like Dos programming.  Windows is event-driven. That
means that your code
ONLY gets run when an event happens. To make "MatrixLife()" run, it has to be
enclosed in an event.
Try this instead...


include Win32lib.ew
without warning
----------------------------------------------------------------------------
----
--  Window MainWin
constant MainWin = createEx( Window, "MatrixLife", 0, Default, Default, 404,
300, 0, 0 )
constant RichEdit2 = createEx( RichEdit, "RichEdit2", MainWin, 4, 6, 328,
232, or_all({ES_NOHIDESEL}), 0 )
constant bttn_Add1 = createEx( PushButton, "+1", MainWin, 336, 22, 56, 28,
0, 0 )
---------------------------------------------------------
procedure onActivate_MainWin(integer self, integer event, sequence parms)

  MatrixLife()

end procedure
setHander(MainWin, w32HActivate, routine_id("onActivate_MainWin"))

WinMain( MainWin,Normal )

--------
However, I don't think that a richedit is right for this type of app (emulating
a DOS screen). Give
me a few minutes to knock up something...

------
Derek.

12/11/2002 1:55:17 PM, "C. K. Lester" <cklester at yahoo.com> wrote:

>
>Why does the following code NOT run the MatrixLife() procedure?
>
>--  code generated by Win32Lib IDE v0.14.2
>
>include Win32lib.ew
>without warning
>
>----------------------------------------------------------------------------
>----
>--  Window MainWin
>constant MainWin = createEx( Window, "MatrixLife", 0, Default, Default, 404,
>300, 0, 0 )
>constant RichEdit2 = createEx( RichEdit, "RichEdit2", MainWin, 4, 6, 328,
>232, or_all({ES_NOHIDESEL}), 0 )
>constant bttn_Add1 = createEx( PushButton, "+1", MainWin, 336, 22, 56, 28,
>0, 0 )
>---------------------------------------------------------
>
>WinMain( MainWin,Normal )
>
>MatrixLife()

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu