wx C++ and wxPython

Hi guys,
I wrote a GUI in C++ using the wx library.
Now I need to generate scietific-like figures and scipy would be
really great.
I know how to use python as scripting language in C, so I could access
scipy. The problem then is the following: is it possible to get back
in C the wxPython figure (probably a panel) and reparent to a window I
generate with wx?
Could you give me some reference or a pseudo-code or even a couple of
commands that could be handy?Or do you think it is better to write
back all the code of the GUI in wxPython

Thanks in advance for the attention
L

There is an example of using wxPython from a wx C++ app in the wxPython distribution in the samples/embedded folder. There are some comments in the code that show how to set up the environment and how to do a few things. Your specific questions may not be answered there, but it will probably get you on the right track.

···

On 7/4/10 11:27 AM, tinauser wrote:

Hi guys,
I wrote a GUI in C++ using the wx library.
Now I need to generate scietific-like figures and scipy would be
really great.
I know how to use python as scripting language in C, so I could access
scipy. The problem then is the following: is it possible to get back
in C the wxPython figure (probably a panel) and reparent to a window I
generate with wx?
Could you give me some reference or a pseudo-code or even a couple of
commands that could be handy?Or do you think it is better to write
back all the code of the GUI in wxPython

--
Robin Dunn
Software Craftsman

Dear Robin,
thanks for the answer.
I had a wxPython runtime version, so I could not figure out how to
link wxwidget and wxpython to the same dll.
I tryed to build then the source code.
I got into problems when trying to install wxpython, namely I get this
error:
File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
"can't copy '%s'": doesn't exist or not a regular file" % src
distutils.errors.DistutilsFileError: can't copy 'C:
\Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

My PATH user variable has \Tools;\Tools\WINNT;\BIN;\MSDev98\BIN;C:\Qt
\3.2.1NonCommercial\bin;C:\Python26;C:\Python26\wxPython-
src-2.8.11.0\lib\vc_dll; C:\Programmi\Microsoft SDKs\Windows\v6.0A
\bin; C:\Program Files\Microsoft Visual Studio 9.0\VC\Bin; C:
\Program Files\Microsoft Visual Studio 9.0\Common7\ID
and the system variable has:
%systemroot%\system32;%systemroot%;%systemroot%\system32\wbem;c:
\programmi\ati technologies\ati control panel;c:\programmi\intel
\wireless\bin\;d:\programmimaster\bin\win32;D:\ProgrammiMaster
\Matlab2007a\bin;D:\ProgrammiMaster\Matlab2007a\bin\win32;C:\Programmi
\Point Grey Research\PGR FlyCapture\bin\;D:\Programmi\TortoiseSVN
\bin;C:\Programmi\QuickTime\QTSystem\;D:\ProgrammiMaster\CMake
2.8\bin;C:\Programmi\Microsoft Visual Studio 9.0\VC\bin;C:\Programmi
\Microsoft Visual Studio 9.0\Common7\IDE;C:\Programmi\Microsoft Visual
Studio 9.0\VC\include;C:\Programmi\Bakefile

So the python command should call the correct interpreter...I can't
understand where is the problem.

I should add I also have an already builded version of
wxWidgets-2.8.11; could the problem orignite from the fact I have
double copy of wxwidget?

Thanks in advance

···

On 5 Lug, 18:51, Robin Dunn <ro...@alldunn.com> wrote:

On 7/4/10 11:27 AM, tinauser wrote:

> Hi guys,
> I wrote a GUI inC++using thewxlibrary.
> Now I need to generate scietific-like figures and scipy would be
> really great.
> I know how to use python as scripting language in C, so I could access
> scipy. The problem then is the following: is it possible to get back
> in C the wxPython figure (probably a panel) and reparent to a window I
> generate withwx?
> Could you give me some reference or a pseudo-code or even a couple of
> commands that could be handy?Or do you think it is better to write
> back all the code of the GUI in wxPython

There is an example of using wxPython from awxC++app in the wxPython
distribution in the samples/embedded folder. There are some comments in
the code that show how to set up the environment and how to do a few
things. Your specific questions may not be answered there, but it will
probably get you on the right track.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

tinauser wrote:

I got into problems when trying to install wxpython, namely I get this
error:
File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
"can't copy '%s'": doesn't exist or not a regular file" % src
distutils.errors.DistutilsFileError: can't copy 'C:
\Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

There is a typo somewhere (I have no idea where), but it's looking for:

C:\Pyhoton26

rather than

C:\Python26

Maybe that will help you find the issue.

-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@noaa.gov

Hi, the typo is there, but is only mine...I don't use dosbox, just
command line and icould not copy-paste. I checked and the message I
get do not have that typo.

···

On 8 Lug, 23:37, Christopher Barker <Chris.Bar...@noaa.gov> wrote:

tinauser wrote:
> I got into problems when trying to install wxpython, namely I get this
> error:
> File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
> "can't copy '%s'": doesn't exist or not a regular file" % src
> distutils.errors.DistutilsFileError: can't copy 'C:
> \Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

There is a typo somewhere (I have no idea where), but it's looking for:

C:\Pyhoton26

rather than

C:\Python26

Maybe that will help you find the issue.

-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.Bar...@noaa.gov

Perhaps, but probably not at this stage. You will want to make sure that when you build your application you are using the same wxWidgets that wxPython uses, not the one you used before.

Do you have WXWIN set in the environment to the root path of the source tree? The preamble.txt file is copied from a location based on the WXWIN variable, and it should not be looking for it in c:\Python26.

···

On 7/8/10 6:14 AM, tinauser wrote:

Dear Robin,
thanks for the answer.
I had a wxPython runtime version, so I could not figure out how to
link wxwidget and wxpython to the same dll.
I tryed to build then the source code.
I got into problems when trying to install wxpython, namely I get this
error:
File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
"can't copy '%s'": doesn't exist or not a regular file" % src
distutils.errors.DistutilsFileError: can't copy 'C:
\Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

So the python command should call the correct interpreter...I can't
understand where is the problem.

I should add I also have an already builded version of
wxWidgets-2.8.11; could the problem orignite from the fact I have
double copy of wxwidget?

--
Robin Dunn
Software Craftsman

Dear Robin,
I had already a version of wxWidget. The version I had was the 2.8.11
To avoid this kind of problem, I downloaded the source code of
wxpython and build the wxwidgets from there. My variable WXWIN is C:
\Python26\wxPython-2.8.11.0 . Is that a problem if it is a folder of
Python?
Could I change the WXWIN to the folder of the wxwidget I had before
and try to build only wxPython (the version of both is te 2.8.11)?

···

On 9 Lug, 19:23, Robin Dunn <ro...@alldunn.com> wrote:

On 7/8/10 6:14 AM, tinauser wrote:

> Dear Robin,
> thanks for the answer.
> I had a wxPython runtime version, so I could not figure out how to
> link wxwidget and wxpython to the same dll.
> I tryed to build then the source code.
> I got into problems when trying to install wxpython, namely I get this
> error:
> File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
> "can't copy '%s'": doesn't exist or not a regular file" % src
> distutils.errors.DistutilsFileError: can't copy 'C:
> \Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

> So the python command should call the correct interpreter...I can't
> understand where is the problem.

> I should add I also have an already builded version of
> wxWidgets-2.8.11; could the problem orignite from the fact I have
> double copy of wxwidget?

Perhaps, but probably not at this stage. You will want to make sure
that when you build your application you are using the same wxWidgets
that wxPython uses, not the one you used before.

Do you have WXWIN set in the environment to the root path of the source
tree? The preamble.txt file is copied from a location based on the
WXWIN variable, and it should not be looking for it in c:\Python26.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

Dear Robin,
I had already a version of wxWidget. The version I had was the 2.8.11
To avoid this kind of problem, I downloaded the source code of
wxpython and build the wxwidgets from there. My variable WXWIN is C:
\Python26\wxPython-2.8.11.0 . Is that a problem if it is a folder of
Python?

No, but it looks like it was not set properly before since setup was trying to access things directly in c:\Python26\... instead of c:\Python26\wxPython-2.8.11.0\...

Could I change the WXWIN to the folder of the wxwidget I had before
and try to build only wxPython (the version of both is te 2.8.11)?

As long as the build flags match up between the two it should be okay.

···

On 7/9/10 12:16 PM, tinauser wrote:

On 9 Lug, 19:23, Robin Dunn<ro...@alldunn.com> wrote:

On 7/8/10 6:14 AM, tinauser wrote:

Dear Robin,
thanks for the answer.
I had a wxPython runtime version, so I could not figure out how to
link wxwidget and wxpython to the same dll.
I tryed to build then the source code.
I got into problems when trying to install wxpython, namely I get this
error:
File "C:\Pyhoton26\lib\distutils\file_util.py", line 119, in copy_file
"can't copy '%s'": doesn't exist or not a regular file" % src
distutils.errors.DistutilsFileError: can't copy 'C:
\Pyhoton26\docs7preamble.txt': doesn't exist or not a regular file

So the python command should call the correct interpreter...I can't
understand where is the problem.

I should add I also have an already builded version of
wxWidgets-2.8.11; could the problem orignite from the fact I have
double copy of wxwidget?

Perhaps, but probably not at this stage. You will want to make sure
that when you build your application you are using the same wxWidgets
that wxPython uses, not the one you used before.

Do you have WXWIN set in the environment to the root path of the source
tree? The preamble.txt file is copied from a location based on the
WXWIN variable, and it should not be looking for it in c:\Python26.

--
Robin Dunn
Software Craftsmanhttp://wxPython.org

--
Robin Dunn
Software Craftsman