mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-09 13:30:08 +01:00
Update wx.TextCompleterSimple example code snippet
This commit is contained in:
@@ -2,26 +2,24 @@
|
||||
class MyTextCompleter(wx.TextCompleterSimple):
|
||||
|
||||
def __init__(self):
|
||||
|
||||
wx.TextCompleterSimple.__init__(self)
|
||||
|
||||
|
||||
def GetCompletions(self, prefix, res):
|
||||
|
||||
def GetCompletions(self, prefix):
|
||||
res = []
|
||||
firstWord = prefix.split()[0]
|
||||
|
||||
if firstWord == "white":
|
||||
res.append("white pawn")
|
||||
res.append("white rook")
|
||||
|
||||
elif firstWord == "black":
|
||||
res.append("black king")
|
||||
res.append("black queen")
|
||||
|
||||
else:
|
||||
res.append("white")
|
||||
res.append("black")
|
||||
|
||||
return res
|
||||
|
||||
|
||||
# Later on...
|
||||
text = wx.TextCtrl(parent, wx.ID_ANY, 'My Text')
|
||||
|
||||
Reference in New Issue
Block a user