Little Bugs -- WIndowisms, an ommision and Pmw.

Hi All,

First off, I want to say I am jaw-droppingly stunned by what panda3d can
do under python!

I am running panda3d on linux, slackware 10.1, and as I have
been working with it today, I have found some (I think) cross-platform
issues and small bugs that linux users and the developers might need to
be aware of…

“System” Colors:

My copy of “Practical Progrmming in Tcl and Tk” talks about Windows
System Colors in chapter 41. It seems that Windows and Mac users of
TCL\TK have some predefined colors that are not available on Unix and
GNU\Linux platforms. These colors have names listed in the book like,
“systemButtonFace” and “systemWindow”.

On my linux box, these colors are undefined, and so produce errors when
one’s program calls “Floater.py” or “Slider.py” in the direct/tkwidgets
directory. Judging from a google search, this a common cross platform
error, but I didn’t really see any solutions that inspired me.

This problem also occurs in the “ParticlePanel.py” file under the
direct/tkpanel directory, but this file seems only to be used by one
of the sample programs (i.e. Tut-Particle-Panel.py),

Case (In)Sensitivity:

Some of the sample programs, call for “direct.gui.DirectGUI” but
my build produced “direct.gui.DirectGui”. Most of the sample programs
call the latter, but two call the former. It breaks on GNU\Linux. I
remember that PC-DOS wasn’t case sensitive, don’t know about windows though.

A Simple Ommision:

One of the coolest demos, Tut-Eve.py, wants to have teapot.egg in it’s model
directory. This is too bad, cause it one of the more well done samples!

Python Mega Widgets:

If prior to installing Panda3d, you install Pmw, it comes with a little
script to make a python Pmw module,( I installed Pmw_1_2 and it comes with
“bundlepmw.py”). This makes a python module which gets installed in your
“PYTHONPATH”. The code in “TkGlobal.py” seems to expect a package instead.
I am probably wrong, but I seem to remember reading that the difference
between a package and a module was the name thingie. Haven’t solved this
to my satisfaction, but I think this is what breaks TkGlobal.py under
GNU\Linux, if you previously installed Python Mega Widgets.

Honestly, if Pmw used distutils, I don’t think this would be
an issue. All I can say for sure, if a python package comes with “setup.py”
I don’t have these kind of problems, when it doesn’t I do.

… None of this stuff is not terribly difficult to figure out. But it
might give newbies and young people fits. It seems like a lot of the
posts on this forum come from people having trouble reading debugging
messages. One would hope that at least the sample programs would work
without errors, “Out of the box”, cross-platform. Hey, at least its a
goal to strive for.

Personally, my history runs from Radio Shack TRS-DOS, to OS/9, to PCDOS,
to OS/2 to Gnu\Linux which I run today. I kinda skipped the whole MS-Windows
thing. I really can’t give any patches that would work on Windows and
GNU\linux. However, I have attached the notes I made while getting things to
run today. Someone with some cross-platform expertise could probably make
quick work of these issues.

Hope this is of some help!

Later,

Robert


  • PROBLEMS WITH ‘SystemWindow’ AND ‘SystemButtonFace’ in TK.
  • As a temporary work-around change the following occurances of
  • ‘SystemWindow’ to ‘gray’.

First…

cp ./lib/direct/tkpanels/ParticlePanel.py ./lib/direct/tkpanels/ParticlePanel.py.stock

Then…

In ./lib/direct/tkpanels/ParticlePanel.py – Line 1606

self.rendererSpriteTextureEntry[‘background’] = ‘SystemWindow’

Change to…

self.rendererSpriteTextureEntry[‘background’] = ‘gray’

In ./lib/direct/tkpanels/ParticlePanel.py – Line 1614

self.rendererSpriteFileEntry[‘background’] = ‘SystemWindow’

Change to…

self.rendererSpriteFileEntry[‘background’] = ‘gray’

In ./lib/direct/tkpanels/ParticlePanel.py – Line 1615

self.rendererSpriteNodeEntry[‘background’] = ‘SystemWindow’

Change to …

self.rendererSpriteNodeEntry[‘background’] = ‘gray’


  • As a temporary work-around change the following occurances of
  • “SystemButtonFace” to “gray85”.

First…

cp ./lib/direct/tkwidgets/Floater.py ./lib/direct/tkwidgets/Floater.py.stock
cp ./lib/direct/tkwidgets/Slider.py ./lib/direct/tkwidgets/Slider.py.stock

Then …

In ./lib/direct/tkwidgets/Floater.py – Line 55

(‘background’, ‘SystemButtonFace’, self.setbackground),

Change to…

(‘background’, ‘gray85’, self.setbackground),

In ./lib/direct/tkwidgets/Slider.py – Line 92

(‘background’, ‘SystemButtonFace’, self.setbackground),

Change to…

(‘background’, 'gray85, self.setbackground),


  • PROBLEM WITH SAMPLES CALLING “Direct.gui.DirectGUI”
  • As a temporary work-around change the following instances of
  • “direct.gui.DirectGUI” to “direct.gui.DirectGui”.

First…

cp ./samples/Feature-Tutorials–Collision-Detection/Tut-Labyrinth.py ./samples/Feature-Tutorials–Collison-Detection/Tut-Labyrinth.py.stock

Then…

In ./samples/Feature-Tutorials–Collision-Detection/Tut-Labyrinth.py
– Line 13

from direct.gui.DirectGUI import *

Change to …

from direct.gui.DirectGui import *


  • PROBLEM WITH JOINT-MANIPULATION SAMPLE NOT FINDING “teapot.egg”
  • As a temporary work-around run the following command from the
  • installation directory.

ln -s ./models/teapot.egg …/…/…/samples/Feature-Tutorials–Joint-Manipulation/models/teapot.egg

            (Cause every virtual girl should have an
              OPENGL teapot, or at least a symlink to one!)

  • PROBLEM WITH PYTHON MEGA WIDGETS INSTALLED AS MODULE VS. PACKAGE?
  • (Admittedly a crude hack, but it gets Tut-Particle-Panel.py going,
  • blowing huge chunks of handled Tk exceptions all the way!)
  • As a temporary work-around change the following instance of"_Pmw" to “Pmw”

First …

cp ./lib/direct/showbase/TkGlobal.py ./lib/direct/showbase/TkGlobal.py.stock

Then …

In ./lib/direct/showbase/TkGlobal.py – Line 6

sys.modules.[’_Pmw]’.name = ‘_Pmw’

Change to …

sys.modules.[‘Pwm’].name = ‘_Pmw’


Just so you know, I’ve already started fixing some of these for 1.0.5

  • Josh