mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 05:20:08 +01:00
Fix __setitem__ and add another test
This commit is contained in:
@@ -180,8 +180,8 @@ def run():
|
||||
c.addPyMethod('__getitem__', '(self, idx)', 'return self.Get()[idx]')
|
||||
c.addPyMethod('__setitem__', '(self, idx, val)',
|
||||
"""\
|
||||
if idx == 0: self.width = val
|
||||
elif idx == 1: self.height = val
|
||||
if idx == 0: self.Start = val
|
||||
elif idx == 1: self.End = val
|
||||
else: raise IndexError
|
||||
""")
|
||||
c.addPyCode('RichTextRange.__safe_for_unpickling__ = True')
|
||||
|
||||
@@ -190,6 +190,12 @@ class richtextbuffer_Tests(wtc.WidgetTestCase):
|
||||
self.assertEqual(start, 111)
|
||||
self.assertEqual(end, 222)
|
||||
|
||||
def test_richtextbuffer14e(self):
|
||||
r = wx.richtext.RichTextRange()
|
||||
self.assertEqual(r.Get(), (0,0))
|
||||
r[0] = 111
|
||||
r[1] = 222
|
||||
self.assertEqual(r.Get(), (111,222))
|
||||
|
||||
|
||||
def test_richtextbuffer15(self):
|
||||
|
||||
Reference in New Issue
Block a user