wxPython problem with panda3d

Hi again,

I need a gui system (multiplatform) to use with panda3d (for loading models, etc). I’m trying with wxPython but I’m getting this error when I try to run it:
:prc(warning): Invalid floating-point value for ConfigVariable simple-thread-epoch-timeslice: 0.05

Then I have to kill the process to close it.

Here is the code:

import wx
from direct.directbase import DirectStart

app = wx.App()

def handleWxEvents(task): 
   while app.Pending(): 
      app.Dispatch() 
   return task.cont 
 
taskMgr.add(handleWxEvents, 'handleWxEvents')
run()

It is from panda3d manual documentation.
Some one know haw to solve it?

Thanks

PD: When I run wxPython alone it works, and when I use panda3d alone it also works.

looks like the good old “wx stuff changes the interpretation of . and , again” error. i am not quite sure but you might get around it by importing the wx stuff after directstart. thought i really dont know for sure.

Thanks for replay. If I import first directStart and then wx I get the same error. I’m using panda3d 1.6.2 and wxpython 2.8.10 on ubuntu 9.10 amd64. I also try with panda3d 1.7.0 but I get the same error.

time ago I was eager as you to have a good GUI and thought was a good idea to use the WX stuff but now not anymore.
Anyhow the best working setup I was able to reach is what you find here - dig into e try to see if fits good for you.

Thanks for the replay. I look this but I have another error. Now I’m trying with Tkinter, and it seems to work. I hope it! hehe

If someone are intrested on it, here is a very simple code:

from Tkinter import *
from direct.directbase import DirectStart

root = Tk() 
frame = Frame(root) 
frame.pack() 
label = Label(frame, text="Hola mundo" ) 
c1 = Checkbutton(frame, text="Uno" ) 
c2 = Checkbutton(frame, text="Dos" ) 
entry = Entry(frame) 
button = Button(frame, text="Aceptar" ) 
label.pack() 
c1.pack() 
c2.pack() 
entry.pack() 
button.pack()
base.startTk()
run()

It’s interesting, the code above is realy works, and even better (on first view) than Tut-Particle-Panel.py (standart example).

There are three questions:

  1. In the code above (posted: Mon Jan 25, 2010 3:39 pm) Tkinter initialised twice: root = Tk() and by Panda3d in base.startTk() (via Pmw). But only one window with controls appears ? How is it ?
  2. Tut-Particle-Panel.py crash when tk-window gets focus (mouse click), if code was running from the IDLE (python GUI). And works well standalone. What the problem with IDLE ?
  3. What package is more perspective for Panda3D: Tkinter or wxPython?

Try to set decimal point to ‘.’ in your system locale before
starting Panda or wx, something like this:

import os
os.putenv("LC_NUMERIC", "en_US.UTF-8")
os.environ["LC_NUMERIC"] = "en_US.UTF-8"