X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/82a074ce2b5dcc6343873e3c458685d5fe903305..31caa11b192593f835bd2848b729f2ebdead3c96:/wxPython/docs/MigrationGuide.txt diff --git a/wxPython/docs/MigrationGuide.txt b/wxPython/docs/MigrationGuide.txt index 70c968ada1..8e5da9fe2e 100644 --- a/wxPython/docs/MigrationGuide.txt +++ b/wxPython/docs/MigrationGuide.txt @@ -281,13 +281,14 @@ that are affected are listed here:: SetClippingRegionAsRegion(region); -If you have code that draws on a DC you **will** get errors because of -these changes, but it should be easy to fix the code. You can either -change the name of the *Type B* method called to the names shown -above, or just add parentheses around the parameters as needed to turn -them into tuples and let the SWIG typemaps turn them into the wx.Point -or wx.Size object that is expected. Then you will be calling the new -*Type A* method. For example, if you had this code before:: +If you have code that draws on a DC and you are using the new wx +namespace then you **will** get errors because of these changes, but +it should be easy to fix the code. You can either change the name of +the *Type B* method called to the names shown above, or just add +parentheses around the parameters as needed to turn them into tuples +and let the SWIG typemaps turn them into the wx.Point or wx.Size +object that is expected. Then you will be calling the new *Type A* +method. For example, if you had this code before:: dc.DrawRectangle(x, y, width, height) @@ -305,6 +306,14 @@ Then you can just simplify it like this:: dc.DrawRectangle(p, s) +Now before you start yelling and screaming at me for breaking all your +code, take note that I said above "...using the new wx namespace..." +That's because if you are still importing from wxPython.wx then there +are some classes defined there with Draw and etc. methods that have +2.4 compatible signatures. However if/when the old wxPython.wx +namespace is removed then these classes will be removed too so you +should plan on migrating to the new namespace and new DC Draw methods +before that time. @@ -352,10 +361,9 @@ For example:: Sizers ------ -The hack allowing the old "option" keyword parameter has been -removed. If you use keyworkd args with wxSizer Add, Insert, or -Prepend then you will need to use the "proportion" name instead of -"option". +The hack allowing the old "option" keyword parameter has been removed. +If you use keyworkd args with wxSizer Add, Insert, or Prepend methods +then you will need to use the "proportion" name instead of "option". When adding a spacer to a sizer you now need to use a wxSize or a 2-integer sequence instead of separate width and height parameters. @@ -378,13 +386,12 @@ into a single extension module, the "core" module is now just a few extensions that are linked independently, and then merged together later into the main namespace via Python code. -Because of the above, the "internal" module names have changed, but -you shouldn't have been using them anyway so it shouldn't bother -you. ;-) +Because of the above and also because of the way the new SWIG works, +the "internal" module names have changed, but you shouldn't have been +using them anyway so it shouldn't bother you. ;-) -The wxPython.help module no longer exists and the classes therein are -now part of the core module imported with wxPython.wx or the wx -package. +The help module no longer exists and the classes therein are now part +of the core module imported with wxPython.wx or the wx package. wxPyDefaultPosition and wxPyDefaultSize are gone. Use the wxDefaultPosition and wxDefaultSize objects instead. @@ -405,3 +412,5 @@ wxPyTypeCast has been removed. Since we've had the OOR (Original Object Return) for a couple years now there should be no need to use wxPyTypeCast at all. +If you use the old wxPython package and wxPython.wx namespace then +there are compatibility aliases for much of the above items.