]> git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/README.txt
027c4f70e156fd3435cfd28b221edcd1c18c7c4b
[wxWidgets.git] / utils / wxPython / README.txt
1 wxPython README
2 ---------------
3
4 Introduction
5 ------------
6 The code in this subtree is a Python Extension Module that enables the
7 use of wxWindows from the Python language. So what is Python? Go to
8 http://www.python.org to learn more but in a nutshell, it's an
9 extremly cool object oriented language. It's easier than Perl and
10 nearly as powerful. It runs on more platforms than Java, and by some
11 reports, is even faster than Java with a JIT compiler!
12
13 So why would you want to use wxPython over just C++ and wxWindows?
14 Personally I prefer using Python for everything. I only use C++ when
15 I absolutly have to eek more performance out of an algorithm, and even
16 then I ususally code it as an extension module and leave the majority
17 of the program in Python. Another good thing to use wxPython for is
18 quick prototyping of your wxWindows apps. With C++ you have to
19 continuously go though the edit-compile-link-run cycle, which can be
20 quite time comsuming. With Python it is only an edit-run cycle. You
21 can easily build an application in a few hours with Python that would
22 normally take a few days with C++. Converting a wxPython app to a
23 C++/wxWindows app should be a straight forward task.
24
25 This extension module attempts to mirror the class heiarchy of
26 wxWindows as closely as possble. This means that there is a wxFrame
27 class in wxPython that looks, smells, tastes and acts almost the same
28 as the wxFrame class in the C++ version. Unfortunatly, I wasn't able
29 to match things exactly because of differences in the languages, but
30 the differences should be easy to absorb because they are natural to
31 Python. For example, some methods that return mutliple values via
32 argument pointers in C++ will return a tuple of values in Python.
33 These differences have not been documented yet so if something isn't
34 working the same as described in the wxWindows documents the best
35 thing to do is to scan through the wxPython sources, especially the .i
36 files, as that is where the interfaces for wxPython are defined.
37
38 I have reports of successfully embedding wxPython within a wxWindows
39 C++ app on GTK. It hasn't yet been attempted on MSW (to my knowledge)
40 so I don't know how successful such an attempt would be. However it
41 is certainly possible.
42
43
44
45 Getting Help
46 ------------
47
48 Since wxPython is a blending of multiple technologies, help comes from
49 multiple sources. See the http://alldunn.com/wxPython for details on
50 various sources of help, but probably the best source is the
51 wxPython-users mail list. You can view the archive or subscribe by
52 going to
53
54 http://starship.python.net/mailman/listinfo/wxpython-users
55
56 Or you can send mail directly to the list using this address:
57
58 wxpython-users@starship.python.net
59
60
61
62 What's new in 2.0b9
63 -------------------
64 Bug fix for ListCtrl in test4.py (Was a missing file... DSM!)
65
66 Bug fix for occassional GPF on Win32 systems upon termination of a
67 wxPython application.
68
69 Added wxListBox.GetSelections returning selections as a Tuple.
70
71 Added a wxTreeItemData that is able to hold any Python object and be
72 associated with items in a wxTreeCtrl. Added test pytree.py to show
73 this feature off.
74
75 Added wxSafeYield function.
76
77 OpenGL Canvas can be optionally compiled in to wxPython.
78
79 Awesome new Demo Framework for showing off wxPython and for learning
80 how it all works.
81
82 The pre-built Win32 version is no longer distributing the wxWindows
83 DLL. It is statically linked with the wxWindows library instead.
84
85 Added a couple missing items from the docs.
86
87 Added wxImage, wxImageHandler, wxPNGHandler, wxJPEGHandler,
88 wxGIFHandler and wxBMPHandler.
89
90
91
92 What's new in 2.0b8
93 -------------------
94 Support for using Python threads in wxPython apps.
95
96 Several missing methods from various classes.
97
98 Various bug fixes.
99
100
101
102 What's new in 2.0b7
103 -------------------
104 Added DLG_PNT and DLG_SZE convienience methods to wxWindow class.
105
106 Added missing constructor and other methods for wxMenuItem.
107
108
109
110 What's new in 2.0b6
111 -------------------
112 Just a quickie update to fix the self-installer to be compatible with
113 Python 1.5.2b2's Registry settings.
114
115
116 What's new in 2.0b5
117 -------------------
118 Well obviously the numbering scheme has changed. I did this to
119 reflect the fact that this truly is the second major revision of
120 wxPython, (well the third actually if you count the one I did for
121 wxWindows 1.68 and then threw away...) and also that it is associated
122 with the 2.0 version of wxWindows.
123
124 I have finally started documenting wxPython. There are several pages
125 in the wxWindows documentation tree specifically about wxPython, and I
126 have added notes within the class references about where wxPython
127 diverges from wxWindows.
128
129 Added wxWindow_FromHWND(hWnd) for wxMSW to construct a wxWindow from a
130 window handle. If you can get the window handle into the python code,
131 it should just work... More news on this later.
132
133 Added wxImageList, wxToolTip.
134
135 Re-enabled wxConfig.DeleteAll() since it is reportedly fixed for the
136 wxRegConfig class.
137
138 As usual, some bug fixes, tweaks, etc.
139
140
141
142 What's new in 0.5.3
143 -------------------
144 Added wxSashWindow, wxSashEvent, wxLayoutAlgorithm, etc.
145
146 Various cleanup, tweaks, minor additions, etc. to maintain
147 compatibility with the current wxWindows.
148
149
150
151 What's new in 0.5.0
152 -------------------
153 Changed the import semantics from "from wxPython import *" to "from
154 wxPython.wx import *" This is for people who are worried about
155 namespace pollution, they can use "from wxPython import wx" and then
156 prefix all the wxPython identifiers with "wx."
157
158 Added wxTaskbarIcon for wxMSW.
159
160 Made the events work for wxGrid.
161
162 Added wxConfig.
163
164 Added wxMiniFrame for wxGTK.
165
166 Changed many of the args and return values that were pointers to gdi
167 objects to references to reflect changes in the wxWindows API.
168
169 Other assorted fixes and additions.
170
171
172
173
174 What's new in 0.4.2
175 -------------------
176
177 wxPython on wxGTK works!!! Both dynamic and static on Linux and
178 static on Solaris have been tested. Many thanks go to Harm
179 <H.v.d.Heijden@phys.tue.nl> for his astute detective work on tracking
180 down a nasty DECREF bug. Okay so I have to confess that it was just a
181 DSM (Dumb Stupid Mistake) on my part but it was nasty none the less
182 because the behavior was so different on different platforms.
183
184
185 The dynamicly loaded module on Solaris is still segfaulting, so it
186 must have been a different issue all along...
187
188
189
190 What's New in 0.4
191 -----------------
192
193 1. Worked on wxGTK compatibility. It is partially working. On a
194 Solaris/Sparc box wxPython is working but only when it is statically
195 linked with the Python interpreter. When built as a dyamically loaded
196 extension module, things start acting weirdly and it soon seg-faults.
197 And on Linux both the statically linked and the dynamically linked
198 version segfault shortly after starting up.
199
200 2. Added Toolbar, StatusBar and SplitterWindow classes.
201
202 3. Varioius bug fixes, enhancements, etc.
203
204
205
206 Build Instructions
207 ------------------
208 I used SWIG (http://www.swig.org) to create the source code for the
209 extension module. This enabled me to only have to deal with a small
210 amount of code and only have to bother with the exceptional issues.
211 SWIG takes care of the rest and generates all the repetative code for
212 me. You don't need SWIG to build the extension module as all the
213 generated C++ code is included under the src directory.
214
215 I added a few minor features to SWIG to control some of the code
216 generation. If you want to playaround with this the patches are in
217 wxPython/SWIG.patches and they should be applied to the 1.1p5 version
218 of SWIG. These new patches are documented at
219 http://starship.skyport.net/crew/robind/python/#swig, and they should
220 also end up in the 1.2 version of SWIG.
221
222 wxPython is organized as a Python package. This means that the
223 directory containing the results of the build process should be a
224 subdirectory of a directory on the PYTHONPATH. (And preferably should
225 be named wxPython.) You can control where the build process will dump
226 wxPython by setting the TARGETDIR makefile variable. The default is
227 $(WXWIN)/utils/wxPython, where this README.txt is located. If you
228 leave it here then you should add $(WXWIN)/utils to your PYTHONPATH.
229 However, you may prefer to use something that is already on your
230 PYTHONPATH, such as the site-packages directory on Unix systems.
231
232
233 Win32
234 -----
235
236 1. Build wxWindows with wxUSE_RESOURCE_LOADING_IN_MSW set to 1 in
237 include/wx/msw/setup.h so icons can be loaded dynamically. While
238 there, make sure wxUSE_OWNER_DRAWN is also set to 1.
239
240 2. Change into the $(WXWIN)/utils/wxPython/src directory.
241
242 3. Edit makefile.vc and specify where your python installation is at.
243 You may also want to fiddle with the TARGETDIR variable as described
244 above.
245
246 4. Run nmake -f makefile.vc
247
248 5. If it builds successfully, congratulations! Move on to the next
249 step. If not then you can try mailing me for help. Also, I will
250 always have a pre-built win32 version of this extension module at
251 http://starship.skyport.net/crew/robind/python.
252
253 6. Change to the $(WXWIN)/utils/wxPython/tests directory.
254
255 7. Try executing the test programs. Note that some of these print
256 diagnositc or test info to standard output, so they will require the
257 console version of python. For example:
258
259 python test1.py
260
261 To run them without requiring a console, you can use the pythonw.exe
262 version of Python either from the command line or from a shortcut.
263
264
265
266 Unix
267 ----
268
269 1. Change into the $(WXWIN)/utils/wxPython/src directory.
270
271 2. Edit Setup.in and ensure that the flags, directories, and toolkit
272 options are correct. See the above commentary about TARGETDIR. There
273 are a few sample Setup.in.[platform] files provided.
274
275 3. Run this command to generate a makefile:
276
277 make -f Makefile.pre.in boot
278
279 4. Run these commands to build and then install the wxPython extension
280 module:
281
282 make
283 make install
284
285
286 5. Change to the $(WXWIN)/utils/wxPython/tests directory.
287
288 6. Try executing the test programs. For example:
289
290 python test1.py
291
292
293
294 ------------------------
295 10/20/1998
296
297 Robin Dunn
298 robin@alldunn.com
299
300
301