wxwidgets: Fix errors running Panda shell

This commit is contained in:
rdb 2023-02-22 12:04:51 +01:00
parent 37b5c9ad9e
commit 4f9092d568
4 changed files with 6 additions and 3 deletions

View File

@ -41,7 +41,7 @@ class LevelEditorBase(DirectObject):
self.fMoveCamera = False
self.NPParent = render
self.NPParent = base.render
# define your own config file in inherited class
self.settingsFile = None

View File

@ -1,6 +1,9 @@
from direct.leveleditor import LevelEditor
if __name__ == '__main__':
from direct.showbase.ShowBase import ShowBase
base = ShowBase()
base.le = LevelEditor.LevelEditor()
# You should define LevelEditor instance as
# base.le so it can be reached in global scope

View File

@ -3237,7 +3237,7 @@ class ShowBase(DirectObject.DirectObject):
# Set a timer to run the Panda frame 60 times per second.
wxFrameRate = ConfigVariableDouble('wx-frame-rate', 60.0)
self.wxTimer = wx.Timer(self.wxApp)
self.wxTimer.Start(1000.0 / wxFrameRate.value)
self.wxTimer.Start(int(round(1000.0 / wxFrameRate.value)))
self.wxApp.Bind(wx.EVT_TIMER, self.__wxTimerCallback)
# wx is now the main loop, not us any more.

View File

@ -119,7 +119,7 @@ class WxPandaShell(WxAppShell):
base.trackball.node().setHpr(0, 15, 0)
# to make persp view as default
self.perspViewMenuItem.Toggle()
self.perspViewMenuItem.Check()
self.onViewChange(None, 3)
# initializing direct