Re: win32lib: manipulating vWinMainState
- Posted by Alexander Toresson <toressonodakra at swipnet.se> Aug 02, 2004
- 496 views
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!