Browse Source

allow any integral type in set()

Darren Ranalli 21 years ago
parent
commit
df408c942f
1 changed files with 2 additions and 1 deletions
  1. 2 1
      direct/src/tkwidgets/VectorWidgets.py

+ 2 - 1
direct/src/tkwidgets/VectorWidgets.py

@@ -4,6 +4,7 @@ import Floater
 import Slider
 import string
 import tkColorChooser
+import types
 
 class VectorEntry(Pmw.MegaWidget):
     def __init__(self, parent = None, **kw):
@@ -170,7 +171,7 @@ class VectorEntry(Pmw.MegaWidget):
         return self._value[index]
                                                                                       
     def set(self, value, fCommand = 1):
-        if type(value) == type(1):
+        if type(value) in (types.FloatType, types.IntType, types.LongType):
             value = [value] * self['dim']
         for i in range(self['dim']):
             self._value[i] = value[i]