mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
fix grayed-out problem
This commit is contained in:
parent
e0b9535308
commit
5fbc37c3e6
@ -516,14 +516,11 @@ class DirectGuiBase(PandaObject.PandaObject):
|
||||
# Find any keyword arguments for this component
|
||||
componentPrefix = componentName + '_'
|
||||
nameLen = len(componentPrefix)
|
||||
|
||||
# First, walk through the option list looking for arguments
|
||||
# than refer to this component's group.
|
||||
|
||||
for option in keywords.keys():
|
||||
if len(option) > nameLen and option[:nameLen] == componentPrefix:
|
||||
# The keyword argument refers to this component, so add
|
||||
# this to the options to use when constructing the widget.
|
||||
kw[option[nameLen:]] = keywords[option][0]
|
||||
# And delete it from main construction keywords
|
||||
del keywords[option]
|
||||
else:
|
||||
# Check if this keyword argument refers to the group
|
||||
# of this component. If so, add this to the options
|
||||
# to use when constructing the widget. Mark the
|
||||
@ -536,6 +533,20 @@ class DirectGuiBase(PandaObject.PandaObject):
|
||||
kw[rest] = keywords[option][0]
|
||||
keywords[option][1] = 1
|
||||
|
||||
# Now that we've got the group arguments, walk through the
|
||||
# option list again and get out the arguments that refer to
|
||||
# this component specifically by name. These are more
|
||||
# specific than the group arguments, above; we walk through
|
||||
# the list afterwards so they will override.
|
||||
|
||||
for option in keywords.keys():
|
||||
if len(option) > nameLen and option[:nameLen] == componentPrefix:
|
||||
# The keyword argument refers to this component, so add
|
||||
# this to the options to use when constructing the widget.
|
||||
kw[option[nameLen:]] = keywords[option][0]
|
||||
# And delete it from main construction keywords
|
||||
del keywords[option]
|
||||
|
||||
# Return None if no widget class is specified
|
||||
if widgetClass is None:
|
||||
return None
|
||||
|
Loading…
x
Reference in New Issue
Block a user