]> git.saurik.com Git - wxWidgets.git/blame - wxPython/docs/MigrationGuide.txt
Made more useable from the command-line, since that is its primary purpose.
[wxWidgets.git] / wxPython / docs / MigrationGuide.txt
CommitLineData
d14a1e28
RD
1============================
2wxPython 2.5 Migration Guide
3============================
4
5This document will help explain some of the major changes in wxPython
62.5 and let you know what you need to do to adapt your programs to
7those changes. Be sure to also check in the CHANGES.txt file like
8usual to see info about the not so major changes and other things that
9have been added to wxPython.
10
11
e8a71fa0
RD
12wxName Change
13-------------
14
15The **wxWindows** project and library is now known as
16**wxWidgets**. Please see here_ for more details.
17
29bfe46b 18.. _here: http://www.wxwidgets.org/name.htm
e8a71fa0
RD
19
20This won't really affect wxPython all that much, other than the fact
21that the wxwindows.org domain name will be changing to wxwidgets.org,
22so mail list, CVS, and etc. addresses will be changing. We're going
23to try and smooth the transition as much as possible, but I wanted you
24all to be aware of this change if you run into any issues.
25
26
d14a1e28
RD
27
28Module Initialization
29---------------------
30
31The import-startup-bootstrap process employed by wxPython was changed
e8a71fa0 32such that wxWidgets and the underlying gui toolkit are **not**
d14a1e28
RD
33initialized until the wx.App object is created (but before wx.App.OnInit
34is called.) This was required because of some changes that were made
35to the C++ wxApp class.
36
37There are both benefits and potential problems with this change. The
38benefits are that you can import wxPython without requiring access to
39a GUI (for checking version numbers, etc.) and that in a
40multi-threaded environment the thread that creates the app object will
41now be the GUI thread instead of the one that imports wxPython. Some
42potential problems are that the C++ side of the "stock-objects"
43(wx.BLUE_PEN, wx.TheColourDatabase, etc.) are not initialized until
44the wx.App object is created, so you should not use them until after
61563ef3 45you have created your wx.App object. If you do then an exception will
cb2d8b77 46be raised telling you that the C++ object has not been initialized
61563ef3 47yet.
d14a1e28
RD
48
49Also, you will probably not be able to do any kind of GUI or bitmap
50operation unless you first have created an app object, (even on
51Windows where most anything was possible before.)
52
53
54
55SWIG 1.3
56--------
57
58wxPython is now using SWIG 1.3.x from CVS (with several of my own
59customizations added that I hope to get folded back into the main SWIG
60distribution.) This has some far reaching ramifications:
61
62 All classes derive from object and so all are now "new-style
63 classes"
64
65 Public data members of the C++ classes are wrapped as Python
66 properties using property() instead of using __getattr__/__setattr__
67 like before. Normally you shouldn't notice any difference, but if
68 you were previously doing something with __getattr__/__setattr__
69 in derived classes then you may have to adjust things.
70
71 Static C++ methods are wrapped using the staticmethod()
72 feature of Python and so are accessible as ClassName.MethodName
73 as expected. They are still available as top level functions
74 ClassName_MethodName as before.
75
76 The relationship between the wxFoo and wxFooPtr classes have
77 changed for the better. Specifically, all instances that you see
78 will be wxFoo even if they are created internally using wxFooPtr,
79 because wxFooPtr.__init__ will change the instance's __class__ as
80 part of the initialization. If you have any code that checks
81 class type using something like isinstance(obj, wxFooPtr) you will
82 need to change it to isinstance(obj, wxFoo).
83
84
85
86Binding Events
87--------------
88
89All of the EVT_* functions are now instances of the wx.PyEventBinder
90class. They have a __call__ method so they can still be used as
91functions like before, but making them instances adds some
29bfe46b 92flexibility that I expect to take advantave of in the future.
d14a1e28
RD
93
94wx.EvtHandler (the base class for wx.Window) now has a Bind method that
95makes binding events to windows a little easier. Here is its
96definition and docstring::
97
98 def Bind(self, event, handler, source=None, id=wxID_ANY, id2=wxID_ANY):
99 """
100 Bind an event to an event handler.
101
102 event One of the EVT_* objects that specifies the
103 type of event to bind.
104
105 handler A callable object to be invoked when the event
106 is delivered to self. Pass None to disconnect an
107 event handler.
108
109 source Sometimes the event originates from a different window
110 than self, but you still want to catch it in self. (For
111 example, a button event delivered to a frame.) By
112 passing the source of the event, the event handling
113 system is able to differentiate between the same event
114 type from different controls.
115
116 id,id2 Used for menu IDs or for event types that require a
117 range of IDs
118
119 """
120
121Some examples of its use::
122
123 self.Bind(wx.EVT_SIZE, self.OnSize)
124 self.Bind(wx.EVT_BUTTON, self.OnButtonClick, theButton)
c8000995
RD
125 self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
126
127
128The wx.Menu methods that add items to a wx.Menu have been modified
129such that they return a reference to the wx.MenuItem that was created.
130Additionally menu items and toolbar items have been modified to
131automatically generate a new ID if -1 is given, similar to using -1
132with window classess. This means that you can create menu or toolbar
133items and event bindings without having to predefine a unique menu ID,
134although you still can use IDs just like before if you want. For
e8a71fa0
RD
135example, these are all equivallent other than their specific ID
136values::
c8000995
RD
137
138 1.
139 item = menu.Append(-1, "E&xit", "Terminate the App")
140 self.Bind(wx.EVT_MENU, self.OnExit, item)
141
142 2.
143 item = menu.Append(wx.ID_EXIT, "E&xit", "Terminate the App")
144 self.Bind(wx.EVT_MENU, self.OnExit, item)
d14a1e28 145
c8000995
RD
146 3.
147 menu.Append(wx.ID_EXIT, "E&xit", "Terminate the App")
148 self.Bind(wx.EVT_MENU, self.OnExit, id=wx.ID_EXIT)
149
150
d14a1e28
RD
151If you create your own custom event types and EVT_* functions, and you
152want to be able to use them with the Bind method above then you should
153change your EVT_* to be an instance of wxPyEventBinder instead of a
29bfe46b 154function. For example, if you used to have something like this::
d14a1e28
RD
155
156 myCustomEventType = wxNewEventType()
157 def EVT_MY_CUSTOM_EVENT(win, id, func):
158 win.Connect(id, -1, myCustomEventType, func)
159
160
161Change it like so::
162
6158f936
RD
163 myCustomEventType = wx.NewEventType()
164 EVT_MY_CUSTOM_EVENT = wx.PyEventBinder(myCustomEventType, 1)
d14a1e28
RD
165
166The second parameter is an integer in [0, 1, 2] that specifies the
167number of IDs that are needed to be passed to Connect.
168
169
170
c8000995
RD
171
172
d14a1e28
RD
173The wx Namespace
174----------------
175
176The second phase of the wx Namespace Transition has begun. That means
177that the real names of the classes and other symbols do not have the
178'wx' prefix and the modules are located in a Python package named
179wx. There is still a Python package named wxPython with modules
180that have the names with the wx prefix for backwards compatibility.
181Instead of dynamically changing the names at module load time like in
1822.4, the compatibility modules are generated at build time and contain
183assignment statements like this::
184
185 wxWindow = wx.core.Window
186
187Don't let the "core" in the name bother you. That and some other
188modules are implementation details, and everything that was in the
189wxPython.wx module before will still be in the wx package namespace
190after this change. So from your code you would use it as wx.Window.
191
192A few notes about how all of this was accomplished might be
193interesting... SWIG is now run twice for each module that it is
194generating code for. The first time it outputs an XML representaion
195of the parse tree, which can be up to 20MB and 300K lines in size!
196That XML is then run through a little Python script that creates a
197file full of SWIG %rename directives that take the wx off of the
198names, and also generates the Python compatibility file described
199above that puts the wx back on the names. SWIG is then run a second
200time to generate the C++ code to implement the extension module, and
201uses the %rename directives that were generated in the first step.
202
203Not every name is handled correctly (but the bulk of them are) and so
204some work has to be done by hand, especially for the reverse-renamers.
205So expect a few flaws here and there until everything gets sorted out.
206
207In summary, the wx package and names without the "wx" prefix are now
208the official form of the wxPython classes. For example::
209
210 import wx
211
212 class MyFrame(wx.Frame):
213 def __init__(self, parent, title):
214 wx.Frame.__init__(self, parent, -1, title)
215 p = wx.Panel(self, -1)
216 b = wx.Button(p, -1, "Do It", (10,10))
217 self.Bind(wx.EVT_BUTTON, self.JustDoIt, b)
218
219 def JustDoIt(self, evt):
220 print "It's done!"
221
222 app = wx.PySimpleApp()
223 f = MyFrame(None, "What's up?")
224 f.Show()
225 app.MainLoop()
226
227You shouldn't need to migrate all your modules over to use the new
228package and names right away as there are modules in place that try to
229provide as much backwards compatibility of the names as possible. If
82a074ce 230you rewrote the above sample using "from wxPython.wx import * ", the
d14a1e28
RD
231old wxNames, and the old style of event binding it will still work
232just fine.
233
234
235
236
237New wx.DC Methods
238-----------------
239
240Many of the Draw methods of wx.DC have alternate forms in C++ that take
241wxPoint or wxSize parameters (let's call these *Type A*) instead of
242the individual x, y, width, height, etc. parameters (and we'll call
243these *Type B*). In the rest of the library I normally made the *Type
244A* forms of the methods be the default method with the "normal" name,
245and had renamed the *Type B* forms of the methods to some similar
246name. For example in wx.Window we have these Python methods::
247
248 SetSize(size) # Type A
249 SetSizeWH(width, height) # Type B
250
251
252For various reasons the new *Type A* methods in wx.DC were never added
253and the existing *Type B* methods were never renamed. Now that lots
254of other things are also changing in wxPython it has been decided that
255it is a good time to also do the method renaming in wx.DC too in order
256to be consistent with the rest of the library. The methods in wx.DC
257that are affected are listed here::
258
259 FloodFillXY(x, y, colour, style = wx.FLOOD_SURFACE)
260 FloodFill(point, colour, style = wx.FLOOD_SURFACE)
261
262 GetPixelXY(x, y)
263 GetPixel(point)
264
265 DrawLineXY(x1, y1, x2, y2)
266 DrawLine(point1, point2)
267
268 CrossHairXY(x, y)
269 CrossHair(point)
270
271 DrawArcXY(x1, y1, x2, y2, xc, yc)
272 DrawArc(point1, point2, center)
273
274 DrawCheckMarkXY(x, y, width, height)
275 DrawCheckMark(rect)
276
277 DrawEllipticArcXY(x, y, w, h, start_angle, end_angle)
278 DrawEllipticArc(point, size, start_angle, end_angle)
279
280 DrawPointXY(x, y)
281 DrawPoint(point)
282
283 DrawRectangleXY(x, y, width, height)
284 DrawRectangle(point, size)
285 DrawRectangleRect(rect)
286
287 DrawRoundedRectangleXY(x, y, width, height, radius)
288 DrawRoundedRectangle(point, size, radius)
289 DrawRoundedRectangleRect(rect, radius)
290
291 DrawCircleXY(x, y, radius)
292 DrawCircle(point, radius)
293
294 DrawEllipseXY(x, y, width, height)
295 DrawEllipse(point, size)
296 DrawEllipseRect(rect)
297
298 DrawIconXY(icon, x, y)
299 DrawIcon(icon, point)
300
301 DrawBitmapXY(bmp, x, y, useMask = FALSE)
302 DrawBitmap(bmp, point, useMask = FALSE)
303
304 DrawTextXY(text, x, y)
305 DrawText(text, point)
306
307 DrawRotatedTextXY(text, x, y, angle)
308 DrawRotatedText(text, point, angle)
309
310
311 BlitXY(xdest, ydest, width, height, sourceDC, xsrc, ysrc,
312 rop = wxCOPY, useMask = FALSE, xsrcMask = -1, ysrcMask = -1)
313 Blit(destPt, size, sourceDC, srcPt,
314 rop = wxCOPY, useMask = FALSE, srcPtMask = wx.DefaultPosition)
315
82a074ce 316 SetClippingRegionXY(x, y, width, height)
4da6d35e
RD
317 SetClippingRegion(point, size)
318 SetClippingRect(rect)
319 SetClippingRegionAsRegion(region);
320
d14a1e28 321
4942342c
RD
322If you have code that draws on a DC and you are using the new wx
323namespace then you **will** get errors because of these changes, but
324it should be easy to fix the code. You can either change the name of
325the *Type B* method called to the names shown above, or just add
326parentheses around the parameters as needed to turn them into tuples
327and let the SWIG typemaps turn them into the wx.Point or wx.Size
328object that is expected. Then you will be calling the new *Type A*
329method. For example, if you had this code before::
d14a1e28
RD
330
331 dc.DrawRectangle(x, y, width, height)
332
333You could either continue to use the *Type B* method bu changing the
334name to DrawRectabgleXY, or just change it to the new *Type A* by
335adding some parentheses like this::
336
337 dc.DrawRectangle((x, y), (width, height))
338
339Or if you were already using a point and size::
340
341 dc.DrawRectangle(p.x, p.y, s.width, s.height)
342
343Then you can just simplify it like this::
344
345 dc.DrawRectangle(p, s)
346
4942342c
RD
347Now before you start yelling and screaming at me for breaking all your
348code, take note that I said above "...using the new wx namespace..."
349That's because if you are still importing from wxPython.wx then there
350are some classes defined there with Draw and etc. methods that have
3512.4 compatible signatures. However if/when the old wxPython.wx
352namespace is removed then these classes will be removed too so you
e75fd8a4 353should plan on migrating to the new namespace and new DC Draw methods
4942342c 354before that time.
d14a1e28
RD
355
356
357
358Building, Extending and Embedding wxPython
359------------------------------------------
360
361wxPython's setup.py script now expects to use existing libraries for
362the contribs (gizmos, stc, xrc, etc.) rather than building local
363copies of them. If you build your own copies of wxPython please be
364aware that you now need to also build the ogl, stc, xrc, and gizmos
29bfe46b 365libraries in addition to the main wx lib.
d14a1e28
RD
366
367The wxPython.h and other header files are now in
368.../wxPython/include/wx/wxPython instead of in wxPython/src. You should
369include it via the "wx/wxPython/wxPython.h" path and add
29bfe46b
RD
370.../wxPython/include to your list of include paths. On OSX and
371unix-like systems the wxPython headers are installed to the same place
372that the wxWidgets headers are installed, so if you building wxPython
373compatible extensions on those platforms then your include path shoudl
374already be set properly.
375
376If you are also using SWIG for your extension then you'll need to
377adapt how the wxPython .i files are imported into your .i files. See
378the wxPython sources for examples. Your modules will need to at least
379``%import core.i``, and possibly others if you need the definition of
380other classes. Since you will need them to build your modules, the
381main wxPython .i files are also installed with the wxPython headers in
382an i_files sibdirectory. It should be enough to pass a -I/pathname on
383the command line for it to find the files.
384
385The bulk of wxPython's setup.py has been moved to another module,
386wx/build/config.py. This module will be installed as part of wxPython
387so 3rd party modules that wish to use the same setup/configuration
388code can do so simply by importing this module from their own setup.py
389scripts using ``import wx.build.config``.
d14a1e28
RD
390
391You no longer need to call wxClassInfo::CleanUpClasses() and
392wxClassInfo::InitializeClasses() in your extensions or when embedding
393wxPython.
394
29bfe46b
RD
395The usage of wxPyBeginAllowThreads and wxPyEndAllowThreads has changed
396slightly. wxPyBeginAllowThreads now returns a boolean value that must
397be passed to the coresponding wxPyEndAllowThreads function call. This
398is to help do the RightThing when calls to these two functions are
399nested, or if calls to external code in other extension modules that
400are wrapped in the standard Py_(BEGIN|END)_ALLOW_THERADS may result in
401wx event handlers being called (such as during the call to
402os.startfile.)
d14a1e28
RD
403
404
405
406Two (or Three!) Phase Create
407----------------------------
408
409If you use the Precreate/Create method of instantiating a window, (for
410example, to set an extended style flag, or for XRC handlers) then
411there is now a new method named PostCreate to help with transplanting
412the brain of the prewindow instance into the derived window instance.
413For example::
414
415 class MyDialog(wx.Dialog):
416 def __init__(self, parent, ID, title, pos, size, style):
417 pre = wx.PreDialog()
418 pre.SetExtraStyle(wx.DIALOG_EX_CONTEXTHELP)
419 pre.Create(parent, ID, title, pos, size, style)
420 self.PostCreate(pre)
421
422
423
424Sizers
425------
426
e6a5dac6 427The hack allowing the old "option" keyword parameter has been removed.
29bfe46b
RD
428If you use keyworkd args with w.xSizer Add, Insert, or Prepend methods
429then you will need to use the ``proportion`` name instead of ``option``.
d14a1e28 430
29bfe46b 431When adding a spacer to a sizer you now need to use a wx.Size or a
d14a1e28
RD
4322-integer sequence instead of separate width and height parameters.
433
29bfe46b 434The wx.GridBagSizer class (very similar to the RowColSizer in the
d14a1e28
RD
435library) has been added to C++ and wrapped for wxPython. It can also
436be used from XRC.
437
438You should not use AddWindow, AddSizer, AddSpacer (and similar for
439Insert, Prepend, and etc.) methods any longer. Just use Add and the
440wrappers will figure out what to do.
441
442
dd346b94
RD
443PlatformInfo
444------------
445
446Added wx.PlatformInfo which is a tuple containing strings that
447describe the platform and build options of wxPython. This lets you
448know more about the build than just the __WXPORT__ value that
449wx.Platform contains, such as if it is a GTK2 build. For example,
450instead of::
451
452 if wx.Platform == "__WXGTK__":
453 ...
454
455you should do this::
456
457 if "__WXGTK__" in wx.PlatformInfo:
458 ...
459
460and you can specifically check for a wxGTK2 build by looking for
461"gtk2" in wx.PlatformInfo. Unicode builds are also detectable this
462way. If there are any other platform/toolkit/build flags that make
463sense to add to this tuple please let me know.
464
465BTW, wx.Platform will probably be deprecated in the future.
466
467
d14a1e28 468
b7c75283
RD
469ActiveX
470-------
471
472Lindsay Mathieson's newest wxActiveX_ class has been wrapped into a new
473extension module called wx.activex. It is very generic and dynamic
474and should allow hosting of arbitray ActiveX controls within your
475wxPython apps. So far I've tested it with IE, PDF, and Flash
476controls, (and there are new samples in the demo and also library
477modules supporting these.)
478
479.. _wxActiveX: http://members.optusnet.com.au/~blackpaw1/wxactivex.html
480
481The new wx.activex module contains a bunch of code, but the most
482important things to look at are ActiveXWindow and ActiveXEvent.
483ActiveXWindow derives from wxWindow and the constructor accepts a
484CLSID for the ActiveX Control that should be created. (There is also
485a CLSID class that can convert from a progID or a CLSID String.) The
486ActiveXWindow class simply adds methods that allow you to query some
487of the TypeInfo exposed by the ActiveX object, and also to get/set
488properties or call methods by name. The Python implementation
489automatically handles converting parameters and return values to/from
490the types expected by the ActiveX code as specified by the TypeInfo,
491(just bool, integers, floating point, strings and None/Empty so far,
492but more can be handled later.)
493
494That's pretty much all there is to the class, as I mentioned before it
495is very generic and dynamic. Very little is hard-coded and everything
496that is done with the actual ActiveX control is done at runtime and
497referenced by property or method name. Since Python is such a dynamic
498language this is a very good match. I thought for a while about doing
499some Python black-magic and making the specific methods/properties of
500the actual ActiveX control "appear" at runtime, but then decided that
501it would be better and more understandable to do it via subclassing.
502So there is a utility class in wx.activex that given an existing
503ActiveXWindow instance can generate a .py module containing a derived
504class with real methods and properties that do the Right Thing to
505reflect those calls to the real ActiveX control. There is also a
506script/tool module named genaxmodule that given a CLSID or progID and
507a class name, will generate the module for you. There are a few
b098694c 508examples of the output of this tool in the wx.lib package, see
b7c75283
RD
509iewin.py, pdfwin.py and flashwin.py.
510
511Currently the genaxmodule tool will tweak some of the names it
512generates, but this can be controled if you would like to do it
513differently by deriving your own class from GernerateAXModule,
514overriding some methods and then using this class from a tool like
515genaxmodule. [TODO: make specifying a new class on genaxmodule's
516command-line possible.] The current default behavior is that any
517event names that start with "On" will have the "On" dropped, property
518names are converted to all lower case, and if any name is a Python
519keyword it will have an underscore appended to it. GernerateAXModule
520does it's best when generating the code in the new module, but it can
521only be as good as the TypeInfo data available from the ActiveX
522control so sometimes some tweaking will be needed. For example, the
523IE web browser control defines the Flags parameter of the Navigate2
524method as required, but MSDN says it is optional.
525
526It is intended that this new wx.activex module will replace both the
527older version of Lindsay's code available in iewin.IEHtmlWindow, and
528also the wx.lib.activexwraper module. Probably the biggest
b098694c 529differences you'll ecounter in migrating activexwrapper-based code
b7c75283
RD
530(besides events working better without causing deadlocks) is that
531events are no longer caught by overriding methods in your derived
532class. Instead ActiveXWindow uses the wx event system and you bind
533handlers for the ActiveX events exactly the same way you do for any wx
534event. There is just one extra step needed and that is creating an
535event ID from the ActiveX event name, and if you use the genaxmodule
536tool then this extra step will be handled for you there. For example,
537for the StatusTextChange event in the IE web browser control, this
538code is generated for you::
539
540 wxEVT_StatusTextChange = wx.activex.RegisterActiveXEvent('StatusTextChange')
541 EVT_StatusTextChange = wx.PyEventBinder(wxEVT_StatusTextChange, 1)
542
543and you would use it in your code like this::
544
545 self.Bind(iewin.EVT_StatusTextChange, self.UpdateStatusText, self.ie)
546
547When the event happens and your event handler function is called the
548event properties from the ActiveX control (if any) are converted to
549attributes of the event object passed to the handler. (Can you say
550'event' any more times in a single sentence? ;-) ) For example the
551StatusTextChange event will also send the text that should be put into
552the status line as an event parameter named "Text" and you can access
b098694c 553it your handlers as an attribute of the event object like this::
b7c75283
RD
554
555 def UpdateStatusText(self, evt):
556 self.SetStatusText(evt.Text)
557
b098694c
RD
558Usually these event object attributes should be considered read-only,
559but some will be defined by the TypeInfo as output parameters. In
560those cases if you modify the event object's attribute then that value
561will be returned to the ActiveX control. For example, to prevent a
562new window from being opened by the IE web browser control you can do
563this in the handler for the iewin.EVT_NewWindow2 event::
564
565 def OnNewWindow2(self, evt):
566 evt.Cancel = True
b7c75283 567
29bfe46b 568So how do you know what methods, events and properties that an ActiveX
b7c75283
RD
569control supports? There is a funciton in wx.activex named GetAXInfo
570that returns a printable summary of the TypeInfo from the ActiveX
571instance passed in. You can use this as an example of how to browse
572the TypeInfo provided, and there is also a copy of this function's
573output appended as a comment to the modules produced by the
574genaxmodule tool. Beyond that you'll need to consult the docs
575provided by the makers of the ActiveX control that you are using.
576
577
578
d14a1e28
RD
579Other Stuff
580-----------
581
582Instead of over a dozen separate extension modules linked together
583into a single extension module, the "core" module is now just a few
584extensions that are linked independently, and then merged together
585later into the main namespace via Python code.
586
e6a5dac6
RD
587Because of the above and also because of the way the new SWIG works,
588the "internal" module names have changed, but you shouldn't have been
589using them anyway so it shouldn't bother you. ;-)
d14a1e28 590
e6a5dac6
RD
591The help module no longer exists and the classes therein are now part
592of the core module imported with wxPython.wx or the wx package.
d14a1e28
RD
593
594wxPyDefaultPosition and wxPyDefaultSize are gone. Use the
595wxDefaultPosition and wxDefaultSize objects instead.
596
597Similarly, the wxSystemSettings backwards compatibiility aliases for
598GetSystemColour, GetSystemFont and GetSystemMetric have also gone into
599the bit-bucket. Use GetColour, GetFont and GetMetric instead.
600
601
ed8e1ecb
RD
602The wx.NO_FULL_REPAINT_ON_RESIZE style is now the default style for
603all windows. The name still exists for compatibility, but it is set
604to zero. If you want to disable the setting (so it matches the old
605default) then you need to use the new wx.FULL_REPAINT_ON_RESIZE style
606flag otherwise only the freshly exposed areas of the window will be
607refreshed.
d14a1e28 608
1f9b31fc
RD
609wxPyTypeCast has been removed. Since we've had the OOR (Original
610Object Return) for a couple years now there should be no need to use
611wxPyTypeCast at all.
d14a1e28 612
e6a5dac6
RD
613If you use the old wxPython package and wxPython.wx namespace then
614there are compatibility aliases for much of the above items.
78862f24
RD
615
616The wxWave class has been renamed to wxSound, and now has a slightly
617different API.
ce32c85b 618
45d67f33
RD
619wx.TaskbarIcon works on wxGTK-based platforms now, however you have to
620manage it a little bit more than you did before. Basically, the app
621will treat it like a top-level frame in that if the wx.TaskBarIcon
622still exists when all the frames are closed then the app will still
623not exit. You need to ensure that the wx.TaskBarIcon is destroyed
624when your last Frame is closed. For wxPython apps it is usually
625enough if your main frame object holds the only reference to the
626wx.TaskBarIcon, then when the frame is closed Python reference
627counting takes care of the rest.
628