Merge pull request #840 from RobinD42/fix-issue836

Fix wx.TextCompleterSimple.GetCompletions
This commit is contained in:
Robin Dunn
2018-05-01 19:53:32 -07:00
parent a62f26450d
commit f1d9c2579c
3 changed files with 9 additions and 3 deletions

View File

@@ -105,6 +105,9 @@ Changes in this release include the following:
* Ensure that the page exists in book controls GetPage and RemovePage methods.
At least one of the wx ports do not do this. (#830)
* Change wx.TextCompleterSimple.GetCompletions to send the list of strings
as a return value, rather than a parameter that gets filled. (#836)

View File

@@ -42,8 +42,9 @@ def run():
c.copyFromClass(tc, 'Start')
c.copyFromClass(tc, 'GetNext')
# TODO: Change GetCompletions to return the wxArrayString instead of
# passing it as a parameter?
# Change GetCompletions to return the wxArrayString instead of passing it
# as a parameter
c.find('GetCompletions.res').out = True
#-----------------------------------------------------------------

View File

@@ -27,9 +27,11 @@ class testcompleter_Tests(wtc.WidgetTestCase):
class MyTextCompleterSimple(wx.TextCompleterSimple):
def __init__(self):
wx.TextCompleterSimple.__init__(self)
def GetCompletions(self, prefix, res):
def GetCompletions(self, prefix):
res = []
res.append("one")
res.append("two")
return res
t = wx.TextCtrl(self.frame)
t.AutoComplete(MyTextCompleterSimple())