peng3d/gui/menus.py
def add_widgets(self,**kwargs):
        """
        Called by the initializer to add all widgets.
        
        Widgets are discovered by searching through the :py:attr:`WIDGETS` class attribute.
        If a key in :py:attr:`WIDGETS` is also found in the keyword arguments and
        not none, the function with the name given in the value of the key will
        be called with its only argument being the value of the keyword argument.
        
        For more complex usage scenarios, it is also possible to override this method
        in a subclass, but the original method should always be called to ensure
        compatibility with classes relying on this feature.
        """
        for name,fname in self.WIDGETS.items():
            if name in kwargs and kwargs[name] is not None:
                assert hasattr(self,fname)
                assert callable(getattr(self,fname))
                getattr(self,fname)(kwargs[name])
def add_widgets(self,**kwargs):
        """
        Called by the initializer to add all widgets.
        
        Widgets are discovered by searching through the :py:attr:`WIDGETS` class attribute.
        If a key in :py:attr:`WIDGETS` is also found in the keyword arguments and
        not none, the function with the name given in the value of the key will
        be called with its only argument being the value of the keyword argument.
        
        For more complex usage scenarios, it is also possible to override this method
        in a subclass, but the original method should always be called to ensure
        compatibility with classes relying on this feature.
        """
        for name,fname in self.WIDGETS.items():
            if name in kwargs and kwargs[name] is not None:
                assert hasattr(self,fname)
                assert callable(getattr(self,fname))
                getattr(self,fname)(kwargs[name])
Called by the initializer to add all widgets.
        
        Widgets are discovered by searching through the :py:attr:`WIDGETS` class attribute.
        If a key in :py:attr:`WIDGETS` is also found in the keyword arguments and
        not none, the function with the name given in the value of the key will
        be called with its only argument being the value of the keyword argument.
        
        For more complex usage scenarios, it is also possible to override this method
        in a subclass, but the original method should always be called to ensure
        compatibility with classes relying on this feature.