Using DirectDialog

Please…
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 cooperlego.py
DirectStart: Starting the game.
Warning: DirectNotify: category 'Interval' already exists
Known pipe types:
  wglGraphicsPipe
(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\threading.py", line 414, in __bootstrap
    self.run()
  File "cooperlego.py", line 73, in run
    mousePicker.Validar_Movi_Lego(msg[1],msg[2],msg[3])
  File "cooperlego.py", 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\DirectDialog.py", line 342, in __init__
    DirectDialog.__init__(self, parent)
  File "C:\Panda3D-1.0.5\direct\src\gui\DirectDialog.py", line 125, in __init__
    cleanupDialog(self['dialogName'])
  File "C:\Panda3D-1.0.5\direct\src\gui\DirectDialog.py", line 29, in cleanupDia
log
    DirectDialog.AllDialogs[uniqueName].cleanup()
  File "C:\Panda3D-1.0.5\direct\src\gui\DirectDialog.py", line 322, in cleanup
    uniqueName = self['dialogName']
  File "C:\Panda3D-1.0.5\direct\src\gui\DirectGuiBase.py", line 436, in cget
    if self._optionInfo.has_key(option):
AttributeError: OkDialog instance has no attribute '_optionInfo'

As I can decide this.

Thanks….

It seems that DirectDialog for v1.0.5 is broken ?

How you find that ue I can decide this problem?

Thanks

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?

David