wxpython设置最大文本框值长度

wxpython设置最大文本框值长度,wxpython,Wxpython,如何在wxpython中设置文本框的最大长度? 这是我的代码(代码的一部分) self.newGameTxt.SetMaxLength(200) import wx from wx.lib.masked import NumCtrl class MyFrame(wx.Frame): def __init__(self,parent,id,title): wx.Frame.__init__(self,parent,id,title) self.panelM

如何在wxpython中设置文本框的最大长度? 这是我的代码(代码的一部分)


self.newGameTxt.SetMaxLength(200)

import wx
from wx.lib.masked import NumCtrl
class MyFrame(wx.Frame):
    def __init__(self,parent,id,title):
        wx.Frame.__init__(self,parent,id,title)
        self.panelMain = wx.Panel(self, -1)
        panel = self.panelMain


        #creating buttons and text boxes.
        self.guessTxt = wx.lib.masked.NumCtrl(self.panelMain,-1,size=(100,20),pos=(50,102))
        self.newGameTxt = wx.TextCtrl(self.panelMain,-1,size=(100,20),pos=(180,73))