On 12/1/06, Angus McMorland <[EMAIL PROTECTED]> wrote:

> Ultimately running the three lines:
>
> from enthought.tvtk.tools import ivtk
> ivtk.IVTKWithBrowser().open() # works okay
> ivtk.IVTKWithCrustAndBrowser().open() # throws up the weird window
>
> led me to think that the problem might be with the shell, since that's
> the difference between these two cases. I've had set ipython to run by
> default at startup, using:
>
> $PYTHONSTARTUP=$HOME/.pythonrc
>
> where .pythonrc is
>
> import IPython
> IPython.Shell.IPShell().mainloop(sys_exit=1)
>
> as listed in the ipython manual, (pdf page 67). However, this is the
> cause of the problem, and removing that startup file fixed the
> problem. It would appear that the threading behaviour of ipython and
> the shell(?) in mayavi2 was the problem. Now that we know, there isn't
> a problem for me per se, but it might be helpful to build in a check
> for this somehow.

Yes: you were starting the 'plain' ipython, and for interactive usage
of TVTK/M2, you need to handle the WX threading issues correctly.
IPython will do this, but you need to start it as

ipython -wthread

from the terminal (or an alias/shortcut) so that it configures itself
explicitly for WX threading (used by Mayavi2).

I'll add a note to the manual indicating that this kind of usage is
probably not a good idea.  I personally don't use it like that, and
simply start ipython manually (optionally with threading support when
I need it).

Cheers,

f

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
MayaVi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mayavi-users

Reply via email to