This is my first post so I hope I explain myself well. I just started learning how to program about three weeks ago.
I chose python becuase SPSS now can interface with Python. So this may seem like an obvious question.
What I am trying to do is set up an entry widget that allows only 11 characters which I learned how to do for a different entry widget. Now I want to put two "/" in the widget as separators for a date. I know how to insert the the "/" but they appear at the front of the widget even after specifying where they should appear. Does anyone have any ideas of 1)how to place them in the correct spots and 2) make them so they can not be deleted by the users.
here is my code
class MyApp: def __init__(self, parent): self.myParent=parent self.myContainer1=Frame(parent) self.myContainer1.pack() self.DOBFrame=Frame(self.myContainer1) self.DOBFrame.pack(side=TOP) self.DOBVAR=StringVar() self.dobtext=Label(self.DOBFrame, text="Offender Date of Birth (mm/dd/yyyy)") self.dobtext.pack(side=LEFT) self.dob=Entry(self.DOBFrame, width=11, relief=SUNKEN, textvariable=self.DOBVAR) self.dob.pack(side=LEFT) self.dob.insert(2, "/") self.dob.insert(5, "/") root=Tk() root.title('CJAD SCS Survey') myapp=MyApp(root) root.mainloop()
Thanks in advance for any help.