Add an item to the list unless it is already present. If the item is an expression, then a semicolon will be appended to it in the final compiled code.
(self, item, position=5)
| 758 | ShaderObject.__init__(self) |
| 759 | |
| 760 | def add(self, item, position=5): |
| 761 | """Add an item to the list unless it is already present. |
| 762 | |
| 763 | If the item is an expression, then a semicolon will be appended to it |
| 764 | in the final compiled code. |
| 765 | """ |
| 766 | if item in self.items: |
| 767 | return |
| 768 | self.items[item] = position |
| 769 | self._add_dep(item) |
| 770 | self.order = None |
| 771 | self.changed(code_changed=True) |
| 772 | |
| 773 | def remove(self, item): |
| 774 | """Remove an item from the list.""" |