mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
Add wx.EmptyBitmap for compatibility, but mark it as deprecated
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70614 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user