1. Why the Stoppage?

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     » topic index » view message » categorize

2. Re: Why the Stoppage?

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 message » categorize

3. Re: Why the Stoppage?

C.K.,

RichEdit uses a "stream text in from a file" method of putting text in the
edit control, which is probably why Derek suggested it wouldn't be a good
"dos" window emulation.  I think the text *replaces* any already there,
instead of adding to the end of existing text.

Any window can have text written to it by wPuts, you just have to
re-position the cursor yourself instead of simple crlf.  See if the demo
example Wstyles.exw helps.

Dan Moyer

----- Original Message -----
From: "C. K. Lester" <cklester at yahoo.com>
To: "EUforum" <EUforum at topica.com>
Sent: Monday, November 11, 2002 7:33 PM
Subject: RE: Why the Stoppage?


>
> > Because "MatrixLife()" runs after "WinMain()" and that doesn't
> > return until you close the window.
>
> Even when I close the window MatrixLife() doesn't run. Shouldn't it at
that
> point?
>
> > 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...
>
> I'm still waiting, slowpoke.
>
> -ck
>
> P.S. That's a joke, people!!! :)
>
>
>
>

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu