Interactive gtk console. Fixed (I think)

push = self.shell.push # Code to execute in user's namespace

    >> lines = ["import matplotlib",
    ---> "matplotlib.use('GTKAgg')",
    >> "matplotlib.interactive(1)", "import matplotlib.matlab as
    >> matlab", "from matplotlib.matlab import *"] You might make the
    >> additional caveat in the docs about honoring rc settings that
    >> the default backend is overridden.

    > Well, actually I think we should honor the user's rc
    > choice, don't you? In fact, the ipython version does
    > this, so the equivalent here would be just to comment
    > out the line you highlighted.

Yes, and along those lines for the GTK shell, we should use
rcParams['backend'] to detect GTK versus GTKAgg and use whichever is
in the rc file in the call to matplotlib.use.

    > Cool. I'll integrate Antoon's and your fixes into the
    > 'real' (read ipython-based) code, and we'll play with
    > that a bit. Do you foresee any problems with the WX
    > backend? Right now I have global pygtk calls, but I
    > suppose those should be done only by the matplotlib
    > shell class IF Gtk is the chosen backend.

Relocating the pygtk calls into the backend dependent section sounds
good. As for problems with wx, I can't really say until we try.

Thanks!
JDH

John Hunter wrote:

Yes, and along those lines for the GTK shell, we should use
rcParams['backend'] to detect GTK versus GTKAgg and use whichever is
in the rc file in the call to matplotlib.use.

Ok. I may take a first stab at this in a day or two, but no promises.

good. As for problems with wx, I can't really say until we try.

I can :frowning: I just tried, and the new code (which doesn't lock up gv), will never start if the backend chosen is WX. But it may be a matter of thread conflicts or something, since pygtk calls are still being made. Let's get Tk*/Gtk* working first, with a well-localized set of thread calls only when needed. With a clean enough base, putting the WX code in the right place should be reasonably easy. Perhaps Andrew (who wanted to hack matplotlib a bit) might help along in LA.

Cheers,

f