]> git.saurik.com Git - wxWidgets.git/blame - utils/wxPython/README.txt
Changes related to stream includes
[wxWidgets.git] / utils / wxPython / README.txt
CommitLineData
7bf85405
RD
1wxPython README
2---------------
3
4Introduction
5------------
6The code in this subtree is a Python Extension Module that enables the
7use of wxWindows from the Python language. So what is Python? Go to
8http://www.python.org to learn more but in a nutshell, it's an
9extremly cool object oriented language. It's easier than Perl and
10nearly as powerful. It runs on more platforms than Java, and by some
11reports, is even faster than Java with a JIT compiler!
12
9c039d08 13So why would you want to use wxPython over just C++ and wxWindows?
7bf85405
RD
14Personally I prefer using Python for everything. I only use C++ when
15I absolutly have to eek more performance out of an algorithm, and even
16then I ususally code it as an extension module and leave the majority
17of the program in Python. Another good thing to use wxPython for is
18quick prototyping of your wxWindows apps. With C++ you have to
19continuously go though the edit-compile-link-run cycle, which can be
20quite time comsuming. With Python it is only an edit-run cycle. You
21can easily build an application in a few hours with Python that would
22normally take a few days with C++. Converting a wxPython app to a
23C++/wxWindows app should be a straight forward task.
24
25This extension module attempts to mirror the class heiarchy of
26wxWindows as closely as possble. This means that there is a wxFrame
27class in wxPython that looks, smells, tastes and acts almost the same
28as the wxFrame class in the C++ version. Unfortunatly, I wasn't able
29to match things exactly because of differences in the languages, but
30the differences should be easy to absorb because they are natural to
31Python. For example, some methods that return mutliple values via
32argument pointers in C++ will return a tuple of values in Python.
33These differences have not been documented yet so if something isn't
34working the same as described in the wxWindows documents the best
35thing to do is to scan through the wxPython sources.
36
37Currently this extension module is designed such that the entire
38application will be written in Python. I havn't tried it yet, but I
39am sure that attempting to embed wxPython in a C++ wxWindows
40application will cause problems. However there is a plan to support
41this in the future.
42
43
9c039d08
RD
44What's New in 0.4
45-----------------
461. Worked on wxGTK compatibility. It is partially working. On a
47Solaris/Sparc box wxPython is working but only when it is statically
48linked with the Python interpreter. When built as a dyamically loaded
49extension module, things acting weirdly and it soon seg-faults. And on
50Linux ??????? (I don't know. I can't get wxGTK to build right now.
51I'll have to look into that... :-)
52
532. Added Toolbar, StatusBar and SplitterWindow classes.
54
553. Varioius bug fixes, enhancements, etc.
56
57
7bf85405
RD
58
59Build Instructions
60------------------
61I used SWIG (http://www.swig.org) to create the source code for the
62extension module. This enabled me to only have to deal with a small
d279310d 63amount of code and only have to bother with the exceptional issues.
7bf85405
RD
64SWIG takes care of the rest and generates all the repetative code for
65me. You don't need SWIG to build the extension module as all the
66generated C++ code is included in the src directory.
67
68wxPython is organized as a Python package. This means that the
69directory containing the results of the build process should be a
70subdirectory of a directory on the PYTHONPATH. (And preferably should
71be named wxPython.) You can control where the bulid process will dump
72wxPython by setting the TARGETDIR makefile variable. The default is
73$(WXWIN)/utils/wxPython, where this README.txt is located. If you
74leave it here then you should add $(WXWIN)/utils to your PYTHONPATH.
75However, you may prefer to use something that is already on your
76PYTHONPATH, such as the site-packages directory on Unix systems.
77
78
79Win32
80-----
81
9c039d08
RD
821. Build wxWindows with wxUSE_RESOURCE_LOADING_IN_MSW set to 1 in
83include/wx/msw/setup.h so icons can be loaded dynamically. While
84there, make sure wxUSE_OWNER_DRAWN is also set to 1.
7bf85405
RD
85
862. Change into the $(WXWIN)/utils/wxPython/src directory.
87
883. Edit makefile.nt and specify where your python installation is at.
89You may also want to fiddle with the TARGETDIR variable as described
90above.
91
924. Run nmake -f makefile.nt
93
945. If it builds successfully, congratulations! Move on to the next
95step. If not then you can try mailing me for help. Also, I will
d279310d 96always have a pre-built win32 version of this extension module at
7bf85405
RD
97http://starship.skyport.net/crew/robind/python.
98
996. Change to the $(WXWIN)/utils/wxPython/tests directory.
100
1017. Try executing the test programs. Note that some of these print
102diagnositc or test info to standard output, so they will require the
103console version of python. For example:
104
105 python test1.py
106
107To run them without requiring a console, you can use the pythonw.exe
108version of Python either from the command line or from a shortcut.
109
110
111
112Unix
113----
114
115NOTE: I don't have wxPython working yet with wxGTK, so if you aren't
116using Win32 you can skip the rest of this file and check back in a
117week or so.
118
119
1201. Change into the $(WXWIN)/utils/wxPython/src directory.
121
1222. Edit Setup.in and ensure that the flags, directories, and toolkit
123options are correct. See the above commentary about TARGETDIR.
124
1253. Run this command to generate a makefile:
126
127 make -f Makefile.pre.in boot
128
1294. Run these commands to build and then install the wxPython extension
130module:
131
132 make
133 make install
134
135
1365. Change to the $(WXWIN)/utils/wxPython/tests directory.
137
1386. Try executing the test programs. For example:
139
140 python test1.py
141
142
143
144------------------------
1458/8/1998
146
147Robin Dunn
2d6dfbb7 148robin@alldunn.com