Hello am getting an error when i try to read the text from a DirectEntry by using the Get command as show below. When i try to use the command function (by pressing enter key), i successfully get the value. But i dont want the player to press enter key. Instead he should click on a button. Any one can help me please?
The error i get is this:
File "C:\Panda3D-1.5.4\direct\src\gui\DirectButton.py", line 103, in commandFunc
apply(self['command'], self['extraArgs'])
File "C:\Shared\CampusWars\NewGameMenu.py", line 33, in setCreate
self.gname =self.t1.get()
File "C:\Panda3D-1.5.4\direct\src\gui\DirectEntry.py", line 280, in get
wantWide = self.unicodeText or self.guiItem.isWtext()
AttributeError: 'DirectEntry' object has no attribute 'guiItem'
That is, you are querying self.t1 immediately after you have called self.destroyAll(). Within self.destroyAll(), you are calling (among other things) self.t1.destroy().
It sure does seem like self.t1 will have been destroyed by the time you call get on it.
Incidentally, aside from the destruction issue, you need to call self.t1.get(), not self.t1.guitItem.get().