mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 03:20:08 +01:00
Add a GetIM() method to Colour, Point, Size, Rect and other ‘value’ types.
GetIM() returns a replicant of the original object that is immutable, so it can be used as a dictionary key, or etc., but still gives access to the properties by name, which using the Get() method to get a tuple of the values does not do.
This commit is contained in:
@@ -48,6 +48,19 @@ class position_Tests(wtc.WidgetTestCase):
|
||||
self.assertTrue(p4 == p1)
|
||||
|
||||
|
||||
def test_GetIM(self):
|
||||
# Test the immutable version returned by GetIM
|
||||
obj = wx.Position(1,2)
|
||||
im = obj.GetIM()
|
||||
assert isinstance(im, tuple)
|
||||
assert im.Row == obj.Row
|
||||
assert im.Col == obj.Col
|
||||
obj2 = wx.Position(im)
|
||||
assert obj == obj2
|
||||
|
||||
|
||||
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user