mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 02:15:43 -04:00
allow any integral type in set()
This commit is contained in:
parent
8446af5e3e
commit
df408c942f
@ -4,6 +4,7 @@ import Floater
|
|||||||
import Slider
|
import Slider
|
||||||
import string
|
import string
|
||||||
import tkColorChooser
|
import tkColorChooser
|
||||||
|
import types
|
||||||
|
|
||||||
class VectorEntry(Pmw.MegaWidget):
|
class VectorEntry(Pmw.MegaWidget):
|
||||||
def __init__(self, parent = None, **kw):
|
def __init__(self, parent = None, **kw):
|
||||||
@ -170,7 +171,7 @@ class VectorEntry(Pmw.MegaWidget):
|
|||||||
return self._value[index]
|
return self._value[index]
|
||||||
|
|
||||||
def set(self, value, fCommand = 1):
|
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']
|
value = [value] * self['dim']
|
||||||
for i in range(self['dim']):
|
for i in range(self['dim']):
|
||||||
self._value[i] = value[i]
|
self._value[i] = value[i]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user