The interact loop

Quick thought:

If you could have the GUI pop up with a "run my code" button, you
could then have the code run in a button event, and:

while True:
rate(100) # clamp to no more than 100 iterations/second; render 3D

This would call a wx.Timer (one shot mode), and it would have a
wx.GetApp().Yield call in there.

That may just work.

Another thought -- strictly speaking, wxPython does not need to be in
the main thread, it just needs to all be in same thread, so your
initialization code can sart up wxPython in a secondary thread, then
your "rate(100)" or whatever function can post an event to wxPython to
refresh the screen. I'm pretty sure iPython used to do a trick like
this to keep a command line open with GUI code.

-Chris

ยทยทยท

scene; trigger event callbacks
b.pos.x += .001 # animate the box, moving to the right across the
screen

I realize that wxPython's MainLoop() doesn't return but continually
dispatches events to callbacks, but is there a way that the rate function
shown above could drive the internals of MainLoop, and thereby trigger event
callbacks?

Another way of expressing what I want to be able to do is to run the user's
program as an idler function, but I don't want novice programmers having to
set up callbacks themselves. I hope I've made it clear what I want to do,
but if not, please ask for clarification.

I'll mention that I'm also developing a JavaScript/WebGL environment,
similar to VPython. It's called GlowScript (glowsccript.org). It too makes
it feasible for novice programmers to write programs that generate real-time
navigable 3D animations, exploiting WebGL without having to know anything
about WebGL.

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

--

Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov