Add a couple more tests for wx.BitmapBundle

This commit is contained in:
Robin Dunn
2022-05-16 15:28:02 -07:00
parent c054d18112
commit 24a0b89f0f

View File

@@ -26,6 +26,24 @@ class bmpbndl_Tests(wtc.WidgetTestCase):
b4 = wx.BitmapBundle(wx.Image(pngFile))
self.assertTrue( b4.IsOk() )
def test_BitmapBundleVector(self):
bmps = [wx.Bitmap(16,16,32),
wx.Bitmap(24,24,32),
wx.Bitmap(32,32,32),
wx.Bitmap(64,64,32)]
bb = wx.BitmapBundle.FromBitmaps(bmps)
self.assertTrue( bb.IsOk() )
b = bb.GetBitmap((32,32))
self.assertTrue(b.IsOk())
self.assertEquals(b.GetSize(), wx.Size(32,32))
def test_BitmapBundle_ImplicitCtor(self):
"Ensure that a wx.Bitmap can still be used where a wx.BitmapBundle is needed"
bmp = wx.Bitmap(pngFile)
btn = wx.Button(self.frame, -1, "Hello")
btn.SetBitmap(bmp)
#---------------------------------------------------------------------------
if __name__ == '__main__':