Using DirectDialog

I’m use DirectDialog for create a popup windows.

self.dialog_validar = OkDialog(dialogName="OkDialog",command=self.DialogValidarDestruir, text = 'cara') 

But when I use for second you see the Dialog to appear this message:

E:\Teste Panda\TCC>ppython
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
(3 aux display modules not yet loaded.)
:express(warning): Adjusting global clock's real time by -1.77118 seconds.
Esta peþa esta sendo usado pelo colaborador
Exception in thread Thread-1:
Traceback (most recent call last):
  File "C:\Panda3D-1.0.5\python\lib\", line 414, in __bootstrap
  File "", line 73, in run
  File "", line 428, in Validar_Movi_Lego
    self.dialog_validar = OkDialog(dialogName="OkDialog",command=self.DialogVali
darDestruir, text = '')
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 342, in __init__
    DirectDialog.__init__(self, parent)
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 125, in __init__
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 29, in cleanupDia
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 322, in cleanup
    uniqueName = self['dialogName']
  File "C:\Panda3D-1.0.5\direct\src\gui\", line 436, in cget
    if self._optionInfo.has_key(option):
AttributeError: OkDialog instance has no attribute '_optionInfo'

As I can decide this.


It seems that DirectDialog for v1.0.5 is broken ?

How you find that ue I can decide this problem?


The problem is that the DirectDialog class wants to have only one instance of itself at a time. When you create a second DirectDialog with the same name, it tries to automatically clean up any previous one you’ve created.

It’s crashing when trying to clean up the previous one–that one appears to have gotten into an incorrect state somehow. Did you do something unusual to the previous dialog?