I get an error saying “String or Unicode required”. I do not know where is it required. Please Help
Thanks in advance
--------------------------------- Code -------------------------------------
#Boa:Dialog:Dialog1
import wx
def create(parent):
return Dialog1(parent)
[wxID_DIALOG1, wxID_DIALOG1BTCANCEL, wxID_DIALOG1BTSAVE, wxID_DIALOG1NAME,
wxID_DIALOG1NUMBER, wxID_DIALOG1STNAME, wxID_DIALOG1STNUMBER,
] = [wx.NewId() for _init_ctrls in range(7)]
class Dialog1(wx.Dialog):
def _init_coll_flexGridSizer1_Items(self, parent):
generated method, don’t edit
parent.AddWindow(self.btSave, 0, border=5, flag=wx.ALL)
parent.AddWindow(self.btCancel, 0, border=5, flag=wx.ALL)
def _init_coll_boxSizer1_Items(self, parent):
generated method, don’t edit
parent.AddWindow(self.stName, 0, border=5, flag=wx.ALL)
parent.AddWindow(self.Name, 0, border=5, flag=wx.ALL)
parent.AddWindow(self.stNumber, 0, border=5, flag=wx.ALL)
parent.AddWindow(self.Number, 0, border=5, flag=wx.ALL)
parent.AddSizer(self.flexGridSizer1, 0, border=0, flag=0)
def _init_sizers(self):
generated method, don’t edit
self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)
self.flexGridSizer1 = wx.FlexGridSizer(cols=0, hgap=0, rows=1, vgap=0)
self._init_coll_boxSizer1_Items(self.boxSizer1)
self._init_coll_flexGridSizer1_Items(self.flexGridSizer1)
self.SetSizer(self.boxSizer1)
def _init_ctrls(self, prnt):
generated method, don’t edit
wx.Dialog.init(self, id=wxID_DIALOG1, name=’’, parent=prnt,
pos=wx.Point(470, 298), size=wx.Size(224, 180),
style=wx.DEFAULT_DIALOG_STYLE, title=‘Add Contact’)
self.SetClientSize(wx.Size(216, 146))
self.stName = wx.StaticText(id=wxID_DIALOG1STNAME, label=u’Name’,
name=u’stName’, parent=self, pos=wx.Point(5, 5), size=wx.Size(27,
13), style=0)
self.Name = wx.TextCtrl(id=wxID_DIALOG1NAME, name=u’Name’, parent=self,
pos=wx.Point(5, 28), size=wx.Size(115, 21), style=0, value=u’’)
self.stNumber = wx.StaticText(id=wxID_DIALOG1STNUMBER, label=u’Number’,
name=u’stNumber’, parent=self, pos=wx.Point(5, 59),
size=wx.Size(37, 13), style=0)
self.Number = wx.TextCtrl(id=wxID_DIALOG1NUMBER, name=u’Number’,
parent=self, pos=wx.Point(5, 82), size=wx.Size(203, 21), style=0,
value=u’’)
self.btSave = wx.Button(id=wxID_DIALOG1BTSAVE, label=u’Save’,
name=u’btSave’, parent=self, pos=wx.Point(5, 113),
size=wx.Size(75, 23), style=0)
self.btCancel = wx.Button(id=wxID_DIALOG1BTCANCEL, label=u’Cancel’,
name=u’btCancel’, parent=self, pos=wx.Point(90, 113),
size=wx.Size(75, 23), style=0)
self._init_sizers()
def init(self, parent):
self._init_ctrls(parent)
if name == ‘main’:
app = wx.PySimpleApp()
dlg = create(None)
try:
dlg.ShowModal()
finally:
dlg.Destroy()
app.MainLoop()
···
Regards
Tanay Shah