From: Patrick B. <pat...@sp...> - 2003-07-16 16:03:19
|
Jonathan, thanks for the reply. For the kinds of simple things I'd like to do, visual's 3D window wouldn't need to be embedded within the wxPython app, it would simply need to be controlled by it. Preferably in a direct manner, but it sounds from your answer like that wouldn't be possible either. Maybe I could start the visual part in its own process and communicate with it via a socket; maybe even just sending the visual "commands" (e.g. "cylinder(axis=(5,0,0), pos=(3,2,1))" etc.) through the socket and having the receiving end just exec() them. Of course that would mean I'd have to learn how to use sockets ;) ... --Pat Jonathan Brandmeyer wrote: >The short answer is "That's not possible," at least not with any >assurance of safety. The long answer is that visual uses its own event >loop to asynchronously cache and process things like keyboard presses >and mouse clicks & drags. Changing this behavior to say, embed a >vpython window within some larger python GUI program (using pyGTK or >wxPython or tkinter for examples) will require a mechanism to provide a >widget to visual that gives visual the necessary functionality. > >That ability to write a new toolkit-specific widget in python and pass >it to visual is not possible right now. However, it is top on my list >of things to do with the new Boost-based interface that is cooking in >CVS. > >-Jonathan Brandmeyer > >On Wed, 2003-07-16 at 11:08, Patrick Bouffard wrote: > > >>Hello, >> >>I've been playing with the visual module for a couple weeks now--first >>off, let me just say, great work! It's great to have a way to cook up >>simple 3D displays without worrying about the low-level details. I would >>even recommend it to colleagues who are starting to learn Python (makes >>for more interesting "hello, world" programs). >> >>My question (request, really) is, could someone post a simple example >>program that uses both visual and wxPython? Searching the archives I >>found some references to this being possible, but my own initial >>attempts always seem to result in some kind of clashing of the main >>loops of wxPython and visual; things like: >> >>GLib-WARNING **: g_main_iterate(): main loop already active in another >>thread >> >>Now, I'm really just starting with wxPython so perhaps the answer is >>really simple; if so just a pointer in the right direction would be fine... >> >>Thanks, >> >>--Pat >> >> > > > |