Browse Source

dgui: fix critical regression introduced by 43a5719

rdb 6 years ago
parent
commit
a0aa7de291
3 changed files with 12 additions and 0 deletions
  1. 1 0
      direct/src/gui/DirectGuiBase.py
  2. 6 0
      tests/gui/test_DirectButton.py
  3. 5 0
      tests/gui/test_DirectEntry.py

+ 1 - 0
direct/src/gui/DirectGuiBase.py

@@ -81,6 +81,7 @@ __all__ = ['DirectGuiBase', 'DirectGuiWidget']
 
 from panda3d.core import *
 from direct.showbase import ShowBaseGlobal
+from direct.showbase import ShowBase
 from . import DirectGuiGlobals as DGG
 from .OnscreenText import *
 from .OnscreenGeom import *

+ 6 - 0
tests/gui/test_DirectButton.py

@@ -0,0 +1,6 @@
+from direct.gui.DirectButton import DirectButton
+
+
+def test_button_destroy():
+    btn = DirectButton(text="Test")
+    btn.destroy()

+ 5 - 0
tests/gui/test_DirectEntry.py

@@ -3,6 +3,11 @@ from direct.gui.DirectEntry import DirectEntry
 import sys
 
 
+def test_entry_destroy():
+    entry = DirectEntry()
+    entry.destroy()
+
+
 def test_entry_get():
     entry = DirectEntry()
     assert isinstance(entry.get(), str)