Help with c++ embedding

Thanks for your replies,

The application itself is actually a legacy app whose GUI is done with WTL (windows template library) which is a thin veneer on top of the windows API. I have matplotlib set to use wxAgg as the backend. I’m not inclined to rebuild the entire app with a different GUI toolkit so from your responses it looks like I’m going to have to do something more complicated using wx directly in the scripts in order to make this type of plotting work. Unfortunately that requires a lot more of a learning curve than I was hoping.

J.D.

···

On Nov 27, 2007 12:33 PM, Christopher Barker <Chris.Barker@…259… > wrote:

John Hunter wrote:

Eeeeew, that looks really dangerous. For starters, I would never try
to do this using pylab,

exactly. the question is – what GUItoolkit are you using with C++?

hopefully it is wx or qt (you’d be using C with GTK, right?).

If so, then use the appropriate back-end, use it like the embedding_in
examples, and then it’s like using GUI toolkit calls with a mixed

C++/Python app without MPL – use the appropriate GUI mailing list for
questions about that.

If you’re not using a GUI toolkit at all with C++, I’d be inclined to
reverse your approach, and use Python+wx (opr QT, or GTK) to host your

app, and extend with the C++.

-Chris


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@…259…


This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/


Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
[

matplotlib-users List Signup and Options](matplotlib-users List Signup and Options)

J.D. Herron wrote:

The application itself is actually a legacy app whose GUI is done with WTL (windows template library) which is a thin veneer on top of the windows API.

Darn.

I have matplotlib set to use wxAgg as the backend. I'm not inclined to rebuild the entire app with a different GUI toolkit so from your responses it looks like I'm going to have to do something more complicated using wx directly in the scripts in order to make this type of plotting work.

yup. I'd post on the wxPython lists -- there are way s to pass Window Handles into/out of wx, so you may be able to get them to work together. I think you can also override the wx mainloop, so that you can deal with the two mainloops problem. This is all wx stuff, MPL isn't anything special in that regard.

Another option is to use plain Agg back-end, and then render the resulting bitmap with WTL. (which I suppose is like building a limited feature MTL-Agg back-end)

-Chris

···

--
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@...259...