diff --git a/etg/bitmap.py b/etg/bitmap.py index 63ea493e..5b740735 100644 --- a/etg/bitmap.py +++ b/etg/bitmap.py @@ -72,7 +72,14 @@ def run(): # TODO: The ctors and methods from Classic for converting to/from # buffer objects with raw bitmap access. - + + + # For compatibility: + module.addPyFunction('EmptyBitmap', '(width, height, depth=BITMAP_SCREEN_DEPTH)', + deprecated=True, + doc='A compatibility wrapper for the wx.Bitmap(width, height, depth) constructor', + body='return Bitmap(width, height, depth)') + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/unittests/test_bitmap.py b/unittests/test_bitmap.py index cdf63475..cc916663 100644 --- a/unittests/test_bitmap.py +++ b/unittests/test_bitmap.py @@ -23,6 +23,17 @@ class BitmapTests(wtc.WidgetTestCase): img = wx.Image(pngFile) b6 = wx.Bitmap(img) self.assertTrue( b6.IsOk() ) + + + def test_EmptyBitmapFactory(self): + # wx.EmptyBitmap is supposed to be deprecated, make sure it is. + import warnings + with warnings.catch_warnings(): + warnings.simplefilter("error") + with self.assertRaises(wx.wxPyDeprecationWarning): + b7 = wx.EmptyBitmap(5,10, 32) + self.assertTrue( b7.IsOk() ) + def test_Bitmap__nonzero__(self):