Re: win32lib: manipulating vWinMainState

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

Derek Parnell wrote:
> 
> Alexander Toresson wrote:
> > 
> > The problem is that the include file should have and control a window,
> > without interrupting the main program. Using the openWindow() procedure
> > works perfect when WinMain() has been called, though the .ew's window is
> > "immune" to events if not. The problem is that vWinMainState is set to
> > kNotStarted.
> > 
> 
> I don't understand the problem. Here is a couple of files that show what
> I think you are trying to do, and they work fine here, so I guess I don't
> really understand what you are trying to acheive.
> 
  snip
> 
> <---File: test.exw--->
> without warning
> include win32lib.ew
> include trace.ew
> constant PrimeWindow = create(Window, "Prime Window", 0, 200,100, 400, 400, 0)
>
> WinMain(PrimeWindow, Normal)    
> <---end of file--->
> 
> 
> When I run the test program, the trace window opens and receives events.

It receives events because you call WinMain(). What I meant is that the
tracer should run even when WinMain() is never called, by polling 
doEvents().
To see the problem, simply replace:

WinMain(PrimeWindow, Normal)


with:

openWindow(PrimeWindow, Normal)
while isVisible(PrimeWindow) do
    doEvents(0)
end while


None of the windows should answer to any event, because vWinMainState is
set to kNotStarted.

Regards, Alexander Toresson

Shhh! Be vewy quiet! I'm hunting wuntime ewwows!

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

Search



Quick Links

User menu

Not signed in.

Misc Menu